I'm curious as to what would make you think otherwise?
Sources: https://sites.google.com/a/newmyths.com/nmwebsite/non_fictio... https://en.wikipedia.org/wiki/Starship_Troopers
“Under our system every voter and officeholder is a man who has demonstrated through voluntary and difficult service that he places the welfare of the group ahead of personal advantage.” - Startship troopers [1]
[1] https://www.goodreads.com/work/quotes/2534973-starship-troop...
And since the only people who would be voting would be the ones who were or had done the dying, it's likely a very strong anti-war book, as one would presume only absolutely necessary wars would ever be fought.
Pacifists happen to join armies less.
But also, Nazi leadership was on the shit end of the stick when it comes to WWI. That did not prevented them to start WWII. Instead, the experience normalized the violence for them and shaped their believes. On the other side, Stalin was fighter in particularly cruel war too in his formative years. Was not peaceful either.
Lastly and less importantly, people who had done dying don't vote, they are dead. Only people who survived previous war vote. And survivors often internalized values that are help to survive the war. They sometimes have hard time to adjust to peaceful life afterwards. Your presumption that "only absolutely necessary wars would ever be fought" has no basis in reality.
Also, your theory assumes that enlisted soldiers actions are motivated primary by self-preservation and will vote on that. Some are, but many are not. Others are motivated by duty, career progression, pride, social status, honor, professionalism, tradition, salary, wish to prove themselves or simply by liking to be in the army structure. In case of your hypothetical army, many men will join for career in politics and social status reasons. People motivated primary by self preservation wont join your hypothetical army.
This may not have been what Heinlein intended to convey. But I tend not to find an author's advocacy relevant when reading fiction. I see the author as giving me rope to hang myself if I choose, rather than considering that they advocate anything at all. As I read it, militarism so permeated that society that the only possible contrarian point of view would come from the reader. And I thought that was the whole point of the book. It doesn't matter whether that's Heinlein's intent.
If it's true Heinlein just didn't convey the vast majority of Federal Service was non-military, and yet all we have to go on is the exclusively militaristic bent as written, that deficiency might make the book all the better just to have the ensuing ideological battles and discussions that resulted. And this book generated quite a lot of them at the time, and I see it as overwhelmingly beneficial.
A likely metaphor to the non-citizens of Starship Troopers are those who of their own volition do not enter into military service, do not vote, do not participate in government - exist in large numbers in the U.S. Most Americans now do not vote, they're simply along for the ride, and in effect aren't citizens in any meaningful way (other than perhaps they can't be deported - but in Starship Troopers it was a world government so there's no concept of deportation anyway).
Just check the wiki page, he wrote it himself (under Major Themes, Militarism): https://en.wikipedia.org/wiki/Starship_Troopers
That's militarism.