Why would you need a textbook code to submit homework? As long as I can read the text of the book (that I pirated), why can't I solve the homework and submit it to my school?
Some classes don't accept paper homework these days, everything is completed online- The textbook publishers have started selling access codes to online homework websites. So s physics professor might decide to use "MasteringPhysics" for all the homework in their class, so every student has to pay ~$100 for a access code (subscription) to that website.
The professors that use these systems like them because they don't have to grade anything. The departments like them because they don't have to pay graders and can have bigger classes. An the publishers LOVE them because students have no choice but to pay.
MyStatLab. $110 just to submit homework I already paid for. I don't get to keep any of it either. I just have my class notes which were never that good.