In fact, the TMP uniforms were test dyed for a variety of colors, including Navy, to see what would take the best. Maroon took the best; thus also giving us the color of the officer's coats so as to match the re-purposed TMP uniforms.
So that's why the jackets are that ugly maroon? Due purely to fabric-dyeing considerations?
Pretty much. Although, it seems that I misremembered. I recalled maroon/dark red being the color that took the best... maybe from another interview, or my short-circuit memory.
It is discussed in this interview with Fletcher:
They decided to salvage what they could from the existing costumes by changing the tailoring and the colours. A series of dye tests showed that the old uniforms would take three different colors well: a blue-grey, a gold, and a dark red. The plan was to use the modified uniforms for the junior cadets, and enough money was found to design an entirely new wardrobe for the ship's officers.
Fletcher was careful not to reproduce any specific naval uniforms and used the dark red colour that had been discovered during the dry tests. Meyer was keen on this approach, since it made the costumes dramatic and created a strong contrast with the background.
Here's a variant of the TMP uniforms (a one-piece uniform with an external pants pocket and cuffs on the sleeves) that were in some of the publicity photos (this particular shot is a scan from one of the Topps ST:TMP trading cards from 1979), but I do not recall seeing them in the film itself...
They wore those uniforms underneath their landing party jackets. Scotty wears one in the final scene on the bridge and Decker wears it in his first scene in the film and in the infamous "woody shot" in the corridor.
Moreover, these were the jumpers that were altered to be the enlisted (black collar) and trainee (red collar) jumpers in TWOK.
Kirk with jacket off, showing the jumper (as seen in the pic above):
Scotty in his: