I would imagine sperm banks do something similar. They have standards for who they accept, they won't take donations from just anyone. And I really doubt they just roll dice and give you a random man's sperm.
Sleeping with some person doesn't tell you anything about, say, their family medical history. Sperm banks check that stuff.