Homework can be a good bridge to university studies imo. I would certainly have benefited from learning self-disciplined study earlier on rather than coasting through the Swedish equivalent of high school and then swapping straight into university.
For under 12s or so I dont see a reason for homework. For 12-18 year olds I think gradually moving to a more self-driven study environment would be a good thing given that most people will end up going to university by now where that is the norm.