Why do you think a military is completely compartmentalized and sectioned off from the Government it's a branch of? Moreover, why do you think it's not civilians that enlist? Soldiers are civilians given the occupation of soldier; they came from the same country, from the same cities, from the same towns.
As for how the military took part in propaganda, that's easy:
https://en.wikipedia.org/wiki/American_propaganda_during_World_War_II
The Government disseminated propaganda. And the military is a part of the Government, else how would politics directly affect it? Construction of equipment, selling of arms, invading specific countries, etc. etc., is handled by both the Government, and the military that is a branch of it.
And yes, your dehumanization of "the enemy" is racism. The very act of dehumanization is racist; you consider other humans to be less than human. You probably also killed human, which makes you a murderer; you end the lives of other humans, ones you were commanded to do so by the Government after you chose to sign up.