Medical emergencies are relatively rare, and between them there is very limited need for medical personnel. It's nice to have a "stowable" doctor, then.
Engineering emergencies may be rare, too, but an emergency system reliant on engineering doesn't make for a very good system for fighting an engineering emergency. You don't want a repairman who shuts down when things go haywire. You want a permanent repairman who can bring your emergency systems (including EMHs) back online in an emergency. Plus, engineers need to monitor things constantly between emergencies, unlike medics who only do very occasional checkups. You don't want to stow away your engineers, nor do you really want to have more than the exact number needed to care for the systems you have onboard, not even in emergencies.
Security emergencies may be very regular on certain types of mission, but generally they are rare. You need a lot of humanoid-shaped bodies to deal with a typical security emergency (as opposed to medical emergencies where just a few extra hands will do, and engineering emergencies where extra hands will only get in the way), and basically none outside emergencies, so "stowability" is very important.
However, security emergencies can also be handled by non-humanoid projections. Medics need to be humanoid to help humanoids, perhaps not in terms of efficiency but in important terms of psychological comfort. Engineers need to be compatible with systems normally operated by humanoids. But an emergency security projection might take the (transparent or invisible) shape of an octopus with a weapon in each tentacle, or of an impenetrable barrier, or of a fierce-looking beast.