You know what? I'll play devil's advocate.
While I agree that homework and school in general is absolute dogshit at what it thinks will teach you about the 'real world' (see this video if you want a better insite on that topic: https://youtu.be/dqTTojTija8?si=vo0Nb-EC2cPVNcM2), I think there is a very, VERY important lesson that homework DOES teach you. That being the hard work that is 1,000% in the 'real world'. Think about it: if have you 2 people who did and did not have any middle and high school experience and have them enter into the 'real world', yes, they would probably have the same intellect, but when faced with hard problems, the person that has delt with hard work would 9 times out of 10 know how to struggle and deal with their adult problems than the person that never knew how to deal with that hard work.