In many cases they did. Look at Pickett's actions in North Carolina.
Which brings up an interesting question. When the rebellion broke out a lot of Southern officers and enlisted left to join the rebel side. Enlisted men at the time signed up for a term of service, same as they do now. Recent West Point grads were obligated to serve for a set period of time, same as now. Wouldn't it stand to reason that the Union could have charged any former enlisted men and any officers who were still under obligation with desertion? And executed them?
The enlisted men? Absolutely. The officers, no. I believe that most, such as Albert Sidney Johnston, PG Beauregard, etc., all resigned their commissions, which was their right. But if an enlisted man had a term to fulfill, then technically, they could be shot for desertion.
I see that you are back from the Democratic Underground.