Just sounds like a hard training session if you puke up, no worries.
If your weeing blood, you could have ruptured or just slightly damaged your “wee pipe” behind your balls (no technical jargon here), due to either banging it on the saddle or hitting a pot hole or hanging over the bars and putting extra pressure on the area.
It may sting when you wee, all you can do is rest and not put pressure on it, ie ride your bike.
It has happened to me and I payed no advise to the Dr. and carried on riding for the next 4 days and was OK.