You are probably thinking backward. I am not an expert in evolutionary biology but the beauty of flowers is something which has helped them survive. Flowers themselves didn't decide to be beautiful or they don't even know that they are beautiful. Remember that evolution is blind. It is just that their beauty was in the eyes of beholders and those beholders helped them survive.