Why polymorphs form?
This is a very broad and very interesting question, but the basic point is: polymorphs exist either because


their formation is controlled by kinetics (rather than thermodynamics, which would favor the most stable phase), or
the thermodynamic equilibrium between the various polymorphs is influenced by the synthesis conditions (temperature, pressure, presence of templating agents and other species in solutions…), and once the material has crystallized in a given form, it does not spontaneously undergo a transition to the most stable phase (again, because of kinetics)