It should be something else stopping us from committing violent or immoral acts of course.
I'm sure that given the nature of this forum, almost every member here has at least some small problem with the "stick method" of governing society, as I like to call it (ie, don't do this or I will beat you with this stick, or put you in prison for life) rather than the "carrot method" (if you behave in this way, I will give you a carrot, or your life will be enriched in some other way).
I would like to think as human culture evolves, we will, collectively, gain a greater and greater understanding of the problems associated with violence, and a greater ability to curb our base emotional impulses and tendencies towards violence, and those innate human tendencies which sometimes lead us to think that fucking over our fellow human being is a good idea. We can already see that this is happening, to some extent - on the whole, the rise of civilisation and large, cohesive, ordered communities has reduced and continues to reduce the incidence of violence in all forms in human societies.
The modern world is a multi-textured, hugely varied place of course, and there are still many places where violence and immorality are relatively commonplace and often go unchecked... and of course, the technology of warfare is a hugely complicating factor... but on the whole, violent and immoral acts committed by individual human beings happen less often, and I would argue that the threat of prison is not the only reason. Those who are lucky enough to grow up in developed nations usually understand through their education and cultural exposure that they do need to curb any desires they might have to do harm to others... And although, of course, the risk of wandering unintentionally into a brutal dystopian future to rival the brutality of the past is there... the potential also exists for us to continue to progress towards becoming a less violent species.
All that said - as long as human beings can in any sense be considered human beings, I do not believe that we will ever completely eliminate these darker tendencies. Our closest genetic relative, the chimpanzee, is arguably the most brutally evil creature alive. Evil of course is a human concept and has no objective meaning in nature, so I say that somewhat ironically, but if the word "evil" were ever to be applied to an animal, it would be applied to a chimpanzee. They are smart enough to recognise and understand that they can inflict pain to others, and yet will calculatedly hunt down their enemies, rip off their balls, gauge out their eyes, and just torture them to death... even among the most depraved human beings in the most dark and brutal era of history, this would be extreme. But anyway, my point is that tendencies to violence and fucking people over just to satisfy our own base desires is hard-coded in our very nature as a species, and although we can try our hardest to curb these darker parts of what we are, I do not believe it's ever going to be possible to entirely defeat them.
As far as my own personal opinion, I would try my best not to do something I consider to be immoral, threat of prison or not, because I understand that if I do this I am just part of a cycle of hatred and suffering that may eventually come back to me, or it may not. Karma is real, although not in the metaphysical sense that some people talk about it. If you choose to take an action that will cause significant harm to someone else, then that person will feel they need to take defensive steps to prevent this happening again. The more bad things happen to them, the more defensive steps they will take until they realise that offense is the best defense, and start to be the perpetrators of suffering and injustice themselves. This is of course why in so many cases the abused become the abusers, and is hopefully a pretty straightforward analogy for the effect that certain actions can have on society at large.
The more banks you rob, the more you contribute to the arms race of more and more security forces, police presence, weapons, surveillance, clamping down on individual freedoms... the more a society evolves in this direction, the more it tends towards warfare, pre-emptive strikes, dehumanisation of the opposition, war crimes, chemical weapons, torture... Nothing we do exists in a vacuum, and like Martin Luther King said, darkness cannot drive out darkness.
So, there are pretty sound logical reasons why if you care at all about your own future or anyone else's you should not commit immoral actions. But of course, it is not always easy to discern what is immoral and what is not, and ultimately none of us are truly rational beings, we are all slaves to our basic animal nature.
Given long enough, I think it's almost a certainty that humanity will destroy themselves because of this, eventually the wrong person at the wrong time will have access to something of inconceivably destructive power... the best hope for humanity is that we can create something better to succeed us...