What law was he upholding when he took the child away from the gay couple? If the state says that homosexuals can be foster parents and if the two people in question were licensed as foster parents then it isn't the judge's place to make a new law. The problem lies with the existing law and solution is rewriting it, and that is the responsibility of the state legislature.
Good luck in convincing anyone here of that.