With a perfectly stiff mast you can build a sail to match exactly one condition. With a flexible mast you can control the amount of draft and draft position yourself and be faster over a wider range of wind (and seastate) by bending the mast.
With a correctly tuned flexible mast the mast will automatically help you alter sailshape as gusts hit, making you faster. Perfectly stiff masts will not be fast on a small boat, as you are not sailing in a windtunnel where all conditions are set and well known. You have to change your sails shape to match the conditions, and you do so by bending the mast.