The transporter can solve virtually all of their problems, which is one thing you need to overlook if you want to enjoy the stories. For example why wouldn't they just run anyone infected through the transporter, using earlier DNA samples as a filter, to remove the Gorn embryos? Similar stuff has worked in other episodes.
I mean, and Christ this episode using the transporter to isolate this thing kind of opened up the possibility of using the transporters against anyone doing anything malign on the ship. Boarding party? Transporter buffer. Monster loose on the cargo deck? Transporter buffer? Captain possessed by an alien entity? Transporter buffer.
I think it's a solvable problem and some TNG/VOY stuff did address this by implying the transporter buffer was in some way very limited. Here perhaps what Scotty did was only possible (despite it being like two keypresses) because he prepared to do it beforehand, or because the confinement device was in exactly the right place at the right time, so I can let it go because they did the smart thing and
didn't explain exactly why that was possible here (often in SF, written or in movies/TV it's better to remain silent about how exactly something works and let your audience imagine why a solution might be limited than to explain in detail and open up a million plot holes/examples of how you don't understand basic science - I'm looking at you Rebecca Chambers!).
Also at least Scotty specifically did it, who TNG had established a true master of messing the transporter buffers (c.f. the TNG episode "Relics").
(PS really like this Scotty actor - he's perfect - better than the original (imho) and incomparably superior to Simon Pegg, who god love him, might as well have been a mildly talented Trek cosplayer they picked up at a random SF con in his portrayal of Scotty.)
I'm guessing that it's one of the reasons that Seth MacFarlane only has shuttles in his Federation analogue and only (I think) one highly advanced alien society displayed transporter-like tech.
Whilst he surprisingly doesn't seem to have commented on it, yeah I'm pretty certain that's the main reason, because he is a serious Trek head (i.e. knows a lot of weird lore, thinks about the setting in his spare time, etc.) in the way RTD is a serious Doctor Who head (and to a lesser extent the other two showrunners of nuWho). It makes drama a huge amount easier to create when you don't have transporters, and avoids you having to incredibly carefully delimit what transporters can do. It's commonly claimed the only reason TOS had transporters was because it was a lot easier for the budget than showing shuttles taking off/landing/being in place on the planet and so on (something which is trivial next to other SFX costs today).