If a store employee steals $500 from the till, gambles it on what he thinks is a sure bet, doubles the money, and returns $600 back to the till, that’s still theft, wrong, and punishable, even if the store happened to win in the end.
Perhaps not an exact analogy, but seems reasonably close.
It must be driving Sam insane though to think he could have made it all fine if he had hung on a few more months.