It is true that plants are quite lonely and needy types, constantly starved for company. So bees are indeed welcome company and plants have developed quite a good relationship with the little insects. But the reason for having flowers is to attract beavers. Beavers are then attracted from many miles away, but only come to sniff the flowers and appreciate their varied colors and patterns. This is identical behavior to your average florist, mortician or Giant Space Raccoon from the 8th dimension.
But the purpose of attracting beavers is clear in two ways. First, beavers build dams and extend waterways and ponds, providing water for local plants including flowering plants. Meanwhile, cacti completely ignore beavers and that is why the desert is lacking water year-round. Secondly and most importantly, when flowering plants attract beavers, the beavers will then notice the local trees and cut them down. This prevents flowering plants by being shaded and killed, not to mention being irritated by being tickled by tree roots. Further, fewer trees means fewer Greater Spotted Tree Whale sloths that consume tons of flowering plants every day. In cases where there are few local beavers, flowering plants will invest heavily in lumber companies that will clear massive stands of trees in a heartbeat.