Most of the time, it's not serious, if it only happens once, and you're under 40.
Are you at risk for STDs? Have you had unprotected oral, vaginal or anal sex? Do you have any other symptoms?
If it goes away, it's nothing to worry about.
https://www.webmd.com/men/guide/blood-in-semen-hematospermia-causes-symptoms-tests-treatments