Starship Troopers fights into the science fiction military genre. Though it is also a satire of military fiction in general, it does a great job of fitting into this slot. The storylines Johnny Rico follows the arc of hope, weakness, failure, redemption, then triumph. The other characters have similar roles, starting off with certain weaknesses then growing through them. Of course, because the grinding attrition is a major part of the background, we see a lot of characters get introduced then killed off.
The bugs feel like a good antagonist. They are swarming, deadly, and grow trickier as the story progresses. The commit at least one abominable act, and reliably do terrible things to the human invaders. Of course there are hints that the bugs did not start the war. The main characters, and the POV of the film dismisses that, emphasizing that all bugs must be killed. But it’s easy to notice that we are definitely invading their planets and wiping them out.
People who are fans of the book may have a complaint. Though there are similarities enough that the movie studio felt the need to license the title, the action, tone, and message are completely different. Heinlein had a tendency towards fascism himself, coupled with a sort of armed libertarian independence streak. Personally, I much prefer the movie, but it is true that Robert A. Heinlein was one of the major figures in the written genre. I read many of his stories growing up.
The spirit of science fiction definitely includes taking a critical look at the institutions of our society and the literature tropes that support them. Starship Troopers is a perfect example of science fiction doing what science fiction does best.