Homework is a proxy for your retention of information and a guide to what you should review. That somehow schools started assigning grades to it is as nonsensically barbaric as public bare ass caning was 80 years ago and driven by the same instinct.
I agree on the grades part. And I was just thinking that the university that I went to never gave us grades during the year (the only exception I can think of was when we did practice exam papers so we had an idea how we were doing).
I think homework is more than a guide to what you should review though. It's partly so that the teacher can find out what students have learned/understood so they can adapt their teaching appropriately. It's also because using class/contact time to do work that can be done independently isn't always the best use of that time (at least once students are willing and capable of doing that work independently).