While immoral is a strong word, I certainly wouldn't take money off my kids if I didn't need it, just to "teach them that money is valuable".
I'd consider it reasonable and right to support them financially while at uni if I can afford it.
If I can't afford it, sit down with them and work out together how to make it work. That may involve them having to find a job or to take a loan.
Once uni is over (so around 23 years old) if they haven't already moved out, sit down with them and talk about what their plan is. If that involves them staying at home I wouldn't charge rent but may ask a contribution towards living costs (so food, utilities, etc). I would also expect them to have some sort of plan (save for a deposit for X months ? Move in with a friend at X date ?)
But no, I wouldn't start charging the moment they turn 18. Surely there is a middle ground between taking money from your 18 year old child and them staying rent-free at home until they're 45...
Obviously if the parent is struggling financially that's different. But otherwise, either you're okay with them staying home, or you're not. Charging them money to "incentivize them to leave" is pretty underhanded. Just tell them you want them to move out.
If they can't afford to move out they probably can't afford to pay rent anyhow.