No hay mal que por bien no venga-->
No hay mal (que recibas) que por bien no (te) venga (después)
The bad thing you receive can be good for you, you must learn/take something good from a bad thing --> your "good things can come from bad"
If you say "No hay bien que por mal no venga...:" you're saying "all the good things comes from bad things", and that's not the same. Good thing can come alone (like lottery
"
saludos