LET’S SAY that a teenager from California moves to Virginia with his family and graduates a year later from a local high school. Under Virginia law, he would be eligible for heavily subsidized in-state tuition rates as a freshman at the University of Virginia, Virginia Tech or any other public college or university in the commonwealth.

Now take a student of the same age brought to Virginia as a child by his undocumented parents. He graduates from elementary, middle and high school; his parents pay taxes; and, thanks to a dispensation granted by the federal government, he may work and live in the United States without fear of deportation. However, if he hopes to continue his education in Virginia, he would have to pay the out-of-state tuition price, which is two or three times higher than the in-state rate.

Nothing about the disparity in treatment for those two students is economically rational or serves Virginia’s interests. The state, having invested heavily in educating undocumented students through high school, squanders their potential by making college prohibitively expensive. College graduates earn more money than those with only a high school diploma, pay more in local and state taxes and more frequently go on to build wealth for others.

At least 16 states have figured out that it makes sense to grant in-state tuition to undocumented students; they include such Republican strongholds as Texas, Utah, Kansas, Nebraska and Oklahoma. But in Richmond last year, the GOP-controlled House of Delegates ignored legislation to do the same. Now the bill is in play again, having gained bipartisan support last week in the House Education Committee. So far there’s no word on whether the Republican leadership will allow it to advance.

Opponents used to dismiss the idea of helping illegal immigrants gain college educations, on the grounds that they could not work legally in this country. But since 2012, the Obama administration’s Deferred Action for Childhood Arrivals program has allowed undocumented immigrants to work and live without fear of deportation, provided they have been in the United States since 2007 and were no older than 15 when they arrived. (Those provisions also mean that the number of undocumented students who would benefit from the Virginia legislation is modest and finite — probably fewer than 1,000 in the next decade or so.) The immigrants in question are hardly freeloaders; to be eligible for in-state tuition in Virginia, their parents would have to show state income tax returns for at least the previous three years.

Republicans in Richmond face a moment of self-definition. They can continue to stonewall. Or they can embrace the new tolerance that House Speaker John A. Boehner (R-Ohio) advocated in urging immigration reform, including opportunity for undocumented immigrants brought to the United States as children through no choice of their own. “One of the great founding principles of our country was that children would not be punished for the mistakes of their parents,” Mr. Boehner said in a statement of principles. Republicans in Richmond should take that to heart.