Most are terrestrial and all lack locomotion. This poses several problems.
Gametes are delicate single cells.
For two plants to cross fertilize, there must be a mechanism for the two gametes to reach each other safely. There must also be a mechanism to disperse their offspring far enough away from the parent so that they do not have to compete with the parent for light, water, and soil minerals. The functions of the flower solve both of these problems. In angiosperms, meiosis in the sporophyte generation produces two kinds of spores. Link to a discussion of the alternation of gametophyte and sporophyte generations Both types of sporangia are formed in flowers.