Conceptually, it is no different than the federal government's Pell Grants that provide money to college-bound students for tuition or the GIBillofRights that did the same thing for millions of veterans.
By the judge's reckoning, the GIBillofRights, which provided scholarship money for WWII vets to go to the colleges of their choice, was unconstitutional because vets were free to use the money to pay tuition at religious-oriented institutions.