The reason for the law is abuse...children taken from poor dysfunctional families and given to affluent white middle class homes when there were friends or family willing to take them in. A lot of older kids were placed with families with a totally different culture, and a lot of them ended up messed up. Amerindians have a long tradition of adoption,but their wishes to place the children within the tribe was overruled by bossy white social workers. And its not just AmerIndians. After the tv show Different Strokes, a lot of affluent parents wanted to adopt black kids to show they are liberal, not because they wanted to care for a kid, But there was a long tradition in the black community to take in the orpaned kids of friends and family Ditto for white kids of course. But they might not be placed by social workers because the person might be older, single,or lack a separate bedroom for every kid.
Another problem is that adoption agencies run by churches tend to place kids with believers.
I would have to wonder if this was to stop discrimination against gay parents.