The learning capacity would be useful simply because the EMH could then deal more swiftly with the specific patients under its care. Being able to cope with complex personalities so that you can ignore the human interaction and cut right to the actual medical emergency takes a lot of skill, specifically skill in adaptation...
Possibly an Emergency Engineering Hologram would never have developed that way, there existing no design need to have it interact with personalities! But even an EEH might still be given a degree of curiosity, not for dealing with Starfleet equipment (no need for flexibility there) or even malfunctions in such (even those would be a limited set), but for dealing with alien technology, a major part of Starfleet engineering operations.
Ultimately, these holograms seem to be programs run by the main computer, rather than independent units. Allocation of resources as needed is a likely way for such things to operate, then, and the engineers might simply have neglected to install proper safeguards there.