No, not all plants have flowers. In fact, there are over 400,000 known species of plants, and only about 252,000 of them are flowering plants. The rest are non-flowering plants, such as mosses, ferns, and conifers.
Why do certain plants have colorful blooms while others don't?
Flowers are a way for flowering plants to reproduce. They contain both male and female reproductive parts, and when pollen from the male parts of the flower is transferred to the female parts, seeds are produced. These seeds then fall to the ground and grow into new plants.
Non-flowering plants reproduce in different ways. Some, such as ferns, produce spores, which are tiny reproductive units that can be dispersed by the wind or by water. Other non-flowering plants, such as mosses, reproduce asexually, meaning that they produce new plants from clones of themselves.

Here are some examples of non-flowering plants:
Mosses
Ferns
Conifers (such as pine trees, firs, and spruces)
Cycads
Ginkgo trees
Horsetails
Whisk ferns
Here are some examples of flowering plants:
Roses
Tulips
Daisies
Orchids
Sunflowers
Maple trees
Grasses
Tomatoes
Potatoes
Corn