Legal action has been taken in several states recently that would put restrictions on who can become foster or adoptive parents on the basis of their sexual orientation or marital status. Such limitations are not only prejudiced but they also significantly reduce the shallow pool of options for vulnerable foster kids in need of good, caring homes.

In Virginia, the State Board of Social Services, acting under pressure from the governor, attorney general and others, recently failed to pass regulations — proposed by the previous administration — that prohibited discrimination based on sexual orientation in adoptions. In April, Arizona’s governor signed a law that would give primary consideration to a married man and woman when placing a child for adoption. Illinois just voted down similar restrictions.

The stakes are already high for the nearly 500,000 young people in our foster-care system. Those who don’t end up in good, lasting homes are at a higher risk of poverty, homelessness, incarceration and early parenthood. While about 120,000 youths are available for adoption each year, 25,000 will reach adulthood without finding permanent families. We can do far better by these children and by the caring individuals who want to be their parents.

Consider the efforts of Martin Gill, who has played an exceptional role in bringing to light some of the flaws in our country’s patchwork of state foster systems. As a foster parent to two young brothers who came to him ill and traumatized — both had ringworm; one also had an ear infection and the other refused to talk — Gill helped them heal and even flourish.

Yet after five years of foster parenting, the state of Florida said Gill could not adopt the boys. Gill is gay, and a state statute bans gay men and lesbians from adopting a child. Gill waged a years-long court battle to keep his family intact. An appeals court ruled in his favor last year, which means that Gill and his sons “won.” Yet a family should never have to endure what his did to stay together.

More than 30 years of research has shown that children develop best with stable attachments to committed and nurturing parents. Their success does not depend on the marital status, sexual orientation or gender identity of the parents. Kids raised by gay and lesbian parents exhibit the same level of emotional, cognitive, social and sexual development as children raised by straight parents.

Only six states — including my home state, California — and the District of Columbia affirmatively allow same-sex couples to adopt jointly. The majority of states are silent on the issues of sexual orientation, marital status or gender identity of adoptive or foster parents. But some states are moving in the wrong direction.

We need a federal remedy. I introduced the Every Child Deserves a Family Act this month to remove all remaining barriers to finding stable, caring permanent homes for America’s foster children. The legislation would restrict federal funding to states that delay or deny placements of foster kids based on the sexual orientation, gender identity or marital status of prospective parents — or based on the sexual orientation or gender identity of the child.

Leading child welfare, public health, medical and legal organizations agree that opening up the homes of all qualified prospective parents can help support the unique needs of each foster child. Groups including the Child Welfare League of America, the National Association of Social Workers, the American Psychological Association and the American Bar Association support the ability of qualified unmarried and lesbian, gay, bisexual or transgender couples to foster and adopt.

Children in our foster-care system are some of our country’s most vulnerable. We must do all we can to find them supportive and loving families. Failing to open every possible door to stable, permanent and loving homes is a grave disservice to these children and to our country.

The writer, a Democrat from California’s 13th Congressional District, is the ranking minority member of the House Ways and Means subcommittee on health.