In other posts I have said how strange, sad, and funny by turns our "morality" lectures were, especially during training for deployment.
No one was ever talking about a real moral code of any recognizable religion. The Army is the government and since our government separates Church and State, it would be wrong to impose any single religious view on the Army. So the Army makes it up.
Like every bad youth organization, whether religious or secular, the Army tries to use the sins of the spirit to keep us from the sins of the flesh. It uses cold-blooded sins to keep us from warm-blooded sins. In case you have not reviewed the Seven Deadly Sins lately, they are (from least to worst):
Some lists switch lust and gluttony as the least, but all ancient lists are clear that the disreputable sins are the least and the arrogant sins are the worst. Sloth sits in the middle because it can be both physical laziness and spiritual laziness. So the sins of the flesh: lust, gluttony, greed and laziness are different from despair (spiritual laziness), anger, envy, and pride.
The sins of the flesh are those committed by those pictured on the pages of People magazine--too much sex, food, and money. The sins of the spirit are those committed by the readers of People magazine: hating, envying, and finally looking down on those who are pictured in People magazine.
Anyway, the Army tells us not to drink, have sex, and take drugs. First we are threatened in various ways, but then the poor guy who is giving the lecture appeals to our self-respect and says we are (or should be) better people than that.
But the Army does it with a lighter touch than a bad youth leader. Because nearly all of our morality lectures ended with something like a plea not to get caught. If you have sex, drink or whatever don't get caught.
Any real morality comes from the inside and shows its results on the outside. The only thing the Army can do is impose moral standards from the outside and hope for some appearance of obedience.
This is very funny on the subject of pornography. The Army bans pornography and makes a big deal of telling us how we can get busted, fined, lose rank, go to jail, etc. for possessing porn, especially on deployment. But the lectures on not having sex often end by saying something like, "Keep your porn to yourself, don't get caught, and wait till you get home for the real thing. In the meantime give yourself a hand."