So you are somewhere behind a robber who is robbing a store at gunpoint to the clerk, he appears to be about to harm the clerk, and he does not know you are there or armed.
Most states are going to have laws that allow you to use lethal force justifiably in that sort of situation, should you decide to act. Is shooting from behind okay in this case? Sure, assuming you are legally justified in using lethal force. There aren't any laws about which I am aware that stipulate where lethal force can be applied to the bad guy's body. Tactically, his back to you is a pretty sweet situation for you and a horrible tactical situation for the robber. Being able to dispatch the robber before he knows you are there will mean that he isn't going to be able to stop or counter your attack.
Walking up and putting your gun to his head is a tactical blunder on your part if you do it. Why? Simple. Distance is your friend and works in your favor in such a situation. The closer you are in proximity to the danger, the more likely it is that you could end up injured or killed. Note, the closer the proximity of you to the bad guy, the less skill he will need to be able to shoot at and hit you.
Note, that contrary to Avizipls, the bad guy does not need to be superman to defeat your gun to his head. A quick pivot spin around will break the muzzle his head, hence defeating or delaying your first shot, assuming he has presence of mind to try it. Once spinning, it is likely he will be able to get off shots toward or into you. Because you are in such close proximity to the robber, the robber is going to pretty well know exactly where you are before he pivots and where you will be after he pivots, pretty much in the same place. At that range, arm's length, he is going to be able to get off shots without the need for aiming.
On top of that, he has another advantage that you won't have. He isn't going to care if he has one or more errant shots that hurt or kill somebody down range behind you. The consequences of hitting a bystander simply won't be a significant consideration for him. You, however, must take bystanders into consideration. You probably can't payoff the civil lawsuit(s) filed against you for hitting the bystander. On top of that, the shooting of a bystander may result in criminal charges filed against you.
These sorts of hypothetical senarios, however, often provide the good guy with one aspect that would not be present in real life. That is, total situational awareness. How can you be certain that the robber is acting alone? Obviously, the robber did not know you were there because he was fixated on the clerk and collecting the till. Like the robber, you may be fixated as well, but on him, and hence not aware of any bad guys that might be behind you or somewhere off to your periphery, unnoticed. Before pulling your gun, did you first check your six and other directions to verify that the robber is alone? Such an act would be most prudent. If there is another bad guy behind you somewhere, he may opt to start shooting you while you attempt to draw your gun. Since you didn't meantion clearing your six and other directions, not going for your gun is a reasonable idea. After all, many such crimes are performed by more than one robber working as a team.
"If you look through your scope and see your shoe, aim higher."
-- said to me by my 11 year old daughter before going out for hogs 8/13/2011