Starfleet as depicted in TMP has got to be the most inept organization in the galaxy. First, there's the routine transport that kills the first officer in a gruesome way.
But it wasn't routine -- that's the point. Kirk was forcing the unfinished Enterprise
into service prematurely to deal with the emergency. Remember, the reason Scotty had to bring Kirk across to the ship in a travel pod (well, the in-story reason) was because the Enterprise
transporters weren't operational yet -- the engineering crew was having problems getting them to work. When Kirk arrived in the engine room minutes before the accident, the engineers' chatter was about "faulty modules" in the transporter that kept its sensors from engaging. Cleary was in the process of putting a new backup sensor in the unit, per Scotty's order, when the transporter room started to engage the transport. Essentially, because they were rushing to do a job in 12 hours that should've been done over days or weeks, mistakes were made, and the accident resulted from that. Kirk's hubris, his zeal to use the crisis as an excuse to get his ship back, has resulted in an unready ship being pushed into service, and two people have died as a result. And Kirk has to live with the consequences of his actions.
Then, there's the total HR cluster---- of having the guy who's going to replace Decker break the news to him. Seems like the could have handled that better.
Again, the haste to prepare for the emergency can explain that. And Kirk's arrogance, his relentless drive to get the ship back without consideration for those under him, was presented as a character flaw he had to surmount. Kirk's arc in the first half of the movie is learning to respect Will Decker. At first he sees Decker as an interloper to be pushed aside, but he's forced to learn that Decker knows more about this new ship and crew than he does, and he needs to tamp down his own ego and trust Decker's judgment. So the way he breaks the news to Decker at the beginning is intended to be Kirk's mistake, not Starfleet's.
Now there's the suggestion from the novelization that, as Christopher said, nearly 90% of Starfleet's finest class couldn't successfully finish their deployments.
So was the anti-Starfleet stuff some kind of meta commentary on Roddenberry's struggles with studio executives to get Phase II/TMP made?
There's no "anti-Starfleet stuff." The line in the novelization was more about being pro-Kirk and pro-Enterprise
, playing into the idea that they were the best and brightest, the most special characters and thus the ones worthy of being the focus of the series. Most series fiction presents its leads as special and beyond the norm. Sherlock Holmes was the only detective who could solve the cases he tackled. James Bond is Her Majesty's top double-0 agent. MacGyver was the Phoenix Foundation's most successful operative. The 4077th had the highest survival rate of any MASH unit in Korea. Scrooge McDuck is the richest duck in the world. And so on. And often, this means that other members of the same organization/profession are only depicted when you need someone for the heroes to rescue, or someone to fail at something the heroes then succeed at. Taken too far, it can give the impression, however unintentionally, that the rest of the organization is pretty much useless. And this is a case where it was taken too far.
Besides, Roddenberry's conceit in the prefacing material of the TMP novelization was that he was a 23rd-century producer who had made a series that dramatized (and in some cases exaggerated) the real adventures of Kirk and crew. I imagine he was trying to explain why it had been that ship and crew, rather than some other, that had been singled out for such a dramatization. And his explanation was that they'd done something nobody else had done.