Clearly the Doctor had lots of learning potential, since he exercised it regularly. But was the learning capacity in the EMH intended for the program to develop an interest in opera or starship command? I don't think so.
Of course not, but what's that got to do with anything? Evolution didn't "intend" the development of opera when it gave us our voices, nor did it intend baseball to be invented when it gave us the ability to throw things. And fields of knowledge devised for one purpose are often adapted to novel and unexpected purposes; for instance, I'm certain a lot of the mathematics used in creating computer graphics was formulated by mathematicians who never imagined there could be such a thing as computer graphics. The reasons why a potential was first created have never been a limitation on the possible applications of that potential.