Its a sexual selection thing. Being a carnivore is much more manly and bad ass, so the plants with these manly tendencies had an easier time getting laid. One moment a dandelion is catching a fly to impress a lady plant, and after a few generations you have fly traps.