Yes, certainly the child's best interests have to be held paramount. I'm not sure they are so seriously threatened as you appear to suggest by placing the child with a gay couple. If, for example, the fear is of bullying due to bigots, this doesn't say anything good about society. Better to change it, and in the long run the only way to do that is to provide examples of successful gay couples, which are, so far as I'm aware, as proportionately common as successful heterosexual couples, if not more so (because of the adoptive v. possibly accidental nature of parenthood).
Moreover, it's been my experience that bigots and bullies will find an excuse to be nasty anyway, whether or not you give them one. Why not just pick on the fact that the child is adopted full stop, regardless of the sexuality of their adoptive parents? If the child is raised by a single parent, no doubt some would pick up on that too. Should we then take the child away from their only parent to protect them from this potential abuse?
Society is anyway changing faster than you give it credit for. There are certainly enough nasty people around who would care about this sort of thing, and pass that hatred onto their children who in turn become bullies. But it's less common, and just as many children wouldn't care one way or another because their parents don't either.
I think your preference against gay couples, anyway, is based on a problem that while it certainly exists isn't large enough to provide a convincing reason to prefer heterosexual to gay couples as adoptive parents. More to the point, even if the problem were large enough, we don't leave in a world where we can make that choice. There are already too many children in care, and not enough adoptive parents, to justify caring so much about whether or not the adoptive parents are of opposite gender.