I agree. It sounds illegal and could be stopped by the courts.
I think it would be illegal (maybe) if this had been a budget but it wasn’t. It’s a spending bill. Rules are different I think and I read that he has this authority with a spending bill.