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 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).