Or maybe the question is, why are flowers important to the plants that host them? Flowers are not the whole plant, they are just a part of the whole plant.
I was taught that the blossoms attract bees and bees are an important part of the pollination process. And pollination is a necessary step in producing seeds that produce the next generation of seedlings. Unpollinated plants produce no seeds. That's a formula for extinction.
So the plants that attract bees the best are the ones that generate the most seeds (in their family of plants) and therefore survive the best generation over generation. Anything that helps attract bees helps with the long-term survival of that plant species. If flowers really do contribute to attracting bees, there is your answer.