As a professor who uses open source textbooks (OpenStax Precalculus, specifically), the homework cost (Webassign at $33.95) is actually something that greatly benefits "good" students. They can have virtually unlimited practice problems, with solutions, through the online homework system. The vast majority of students prefer online homework to the old "do this on paper, turn it in, get back next class and hope I did it correctly" style. They can immediately see when they get a problem incorrect, then can come see me, spend time combing through the book, notes, Khan Academy, etc to get help. As for crappy students, they don't give a crap, no matter what.
While this isn't free, I'd say charging $33.95 is a hell of a lot better than the $200 textbook we dumped for this approach. This also beats Pearson's MyMathlab price of $99 for similar access (and closed source textbook access).
There are free online HW sites, but if you ever test them, there is quite a bit of hidden cost. I can set up a Moodle server and run my own question banks, but then I need to make sure I have something accessible from anywhere, with enough capacity to allow a few thousand students access. I can write questions on Blackboard (our campus LMS), but the mathematics support is god awful. I can use MAA's system, but it's more expensive than Webassign (unless I host it myself).