Your question is if people only live for a finite time why shouldn't they do bad stuff if they think they can get away with it?
Morality is about how to make decisions. This covers everything that people usually think of as morality and more. For example, if we ask whether abortion is moral or not that's a question about how to make decisions about whether to get an abortion. People who oppose abortion would claim that a woman should always make a negative decision when considering whether to get an abortion. People who think abortion should be allowed would say that a woman should sometimes say yes when considering whether to get an abortion.
Some philosophers say morality is about emotions, dispositions and that sort of thing, e.g. - morality is about whether you should care for one child more than another or whatever. All such issues are about how you should make decisions about emotional issues and so are included in saying that morality is about how to make decisions. Some philosophers may wish to limit the set of decisions under considerations to emotions or dispositions or whatever. This rips moral problems, including moral problems about emotions, out of context and makes it more difficult to solve them. This is a substantive and bad moral theory.
The main question you ought to ask is whether the action benefits you. If the action doesn't benefit you that is a criticism of it. If there is a criticism of taking a particular action then it is a bad idea even if you don't know about the criticism. Stupidity will not stop adverse consequences of bad stuff you do, so thinking that you can do something immoral and "get away with it" will not save you.
There are some bad actions you can take that only affect you. If your respond to a fault in your computer by getting angry and hitting the computer that is bad and stupid. You took a substantial risk of harming your computer, which was a bad idea. In addition, you have wasted time by getting angry rather than trying to think about how to solve your problem. There is no such thing as getting away with doing something stupid and bad like that.
But let's suppose that you take an action that harms somebody else and you get away with it in the sense that at present the other person hasn't found out. If he does find out then he may be less willing to cooperate with you in future. You have no way of guaranteeing the other person won't find out. He might find out himself or somebody else might find out and tell him. You might inadvertently betray the secret yourself by slipping up. You have to keep track of how your deceived him and all the consequences of that or take a large risk of him finding out.
Also whether he will find out depends not just on you and him but on everybody else that either of you deals with, so there is no way you can reasonably expect to succeed. Whether other people will find out will depend on what knowledge they have now, which you largely don't know. It also depends on what knowledge they will create in the future which you can't possibly know. Other people interact with you directly and indirectly so their future knowledge is influenced by your future knowledge. You can't predict what knowledge you will have in the future because if you could predict what you will know tomorrow you would already know it.
Let's suppose that nobody finds out about the bad thing you did. Even leaving aside the cost of trying to cover up your misdeed, there is another problem. Your bad action was a result of bad ways of thinking about how to make decisions. By doing the bad thing and covering it up you have covered up your ignorance so that you haven't received feedback on how you could do better or fixed the problem yourself.
To understand more about secular morality read "The Beginning of Infinity" by David Deutsch and Ayn Rand has written a lot of relevant stuff: "The Virtue of Selfishness", "The Fountainhead", "Atlas Shrugged", "Philosophy who needs it" and "The Voice of Reason".