The movie started filming under that name and someone at the studio later realized the similarities with Heinlein's novel and they sought a license to avoid a lawsuit.
The second paragraph in the following is a quote from a statement made by Verhoeven about making the movie. See  in article.
The film started life as a script called Bug Hunt at Outpost Nine. When similarities, especially the "bugs", were pointed out between this and the novel Starship Troopers, plans were made to license the rights to the book and tweak character names and circumstances to match. Verhoeven had never read the book, and attempted to read it for the film, but it made him "bored and depressed", so he read only a few chapters:
I stopped after two chapters because it was so boring,...It is really quite a bad book. I asked Ed Neumeier to tell me the story because I just couldn't read the thing. It's a very right-wing book.
The really interesting thing about the above is Verhoeven's statement. Namely, Verhoeven tried to read the book and gave up, so he asked Ed Neumier to tell him about the story (i.e., the book). That means Neumier, the script writer, was aware of Heinlien's book and its contents before he wrote the script.
If Neumier used the book as the basis for the script, it is likely that he changed the character's names and modified scenes. Then after obtaining the rights to the book, the studio tweaked the character names and circumstances of the script to match the book.