People raise their flush/straight draws if they have fold equity vs their opponents + the equity they already have in the pot (for a flush draw to hit with 2 cards to come its ~35%). Those two combined will typically make it a +EV (expected value) play in the long run.

Obviously, you shouldn't be raising your draw when you have zero or next to zero fold equity.