If a kid is turned over to the government, THEN I do think the government has the right to discriminate in who it gives the kid to. Along with police, fire, military, roads........protecting abandoned children is among the few gov't functions I believe in.
And yes, I don't think placing a kid in the home of two flamers is necessarily good for it. That kid will encounter issues down the road from peers, at minimum, and be confused as shit at worst.