So it's the schools that are in on it and the primary target to put blame on. My university (in eastern EU) had majority of textbooks available for free. We could print them ourselves, have them printed at school, or just buy used. I'm sure it wasn't the case for all curriculums, but probably for many. Writing textbooks is one of the things teachers (professors) do after all.