The underlying issue is something that is hinted at in JDH's answer, but not explicitly stated. So I'd like to state it.
The key is to decide what your homework is for. The big words are Formative and Summative. In short, formative assessment is designed to help you learn, summative assessment is designed to figure out what you've learnt.
The distinction is not clear cut, and I'm no expert so I won't pretend to be. In truth, all assessment is a mixture since unless we know what we have learnt, how can we figure out how to learn it better? And if we don't use the assessment of what we've learnt to find out more, what was the point in measuring it?
Nevertheless, we can broadly assign assessment to one of the two classes by its primary use. I suspect that the majority opinion would be that homeworks are for formative assessment. We only grade them to encourage students to do them, reasoning that if we don't give the students credit for doing them then they won't choose to do so of their own free will (but note quid's comment on the question!).
Unfortunately, this sends out the wrong message. By counting them as part of the final grade, the students view the homeworks as summative: a measure of what they have learnt, and therefore view them as something to achieve rather than as something to reflect upon.
Also unfortunately, the default assumption on students' part seems to be that all assessment is summative. This is because the majority are not aware of these nuances, and are more aware of the occasions where they have undergone summative assessment rather than formative (the latter being, by its nature, less stressful and more subtle, and so less noticeable).
Therefore it is not enough to simply say "Do the homework for your own good". You will need to set up a culture of reflection. Here are some broad guidelines. Again, I'm not an expert and have not implemented (all of) these myself.
If you must include a homework part in the overall assessment, make the bar as low as possible. Essentially, if they try the homework they should get the credit.
Use feedback from the homeworks in your teaching. Use the homeworks to find out what people found difficult and then go over that again in class time. Make it so that the students see the link between the information that they give you through the homeworks and the help that they get afterwards.
In my course, the rule is that they need 8 out of 12 homeworks "approved" to be able to take the final exam. Other than that, the homeworks don't count. Nevertheless, because we don't really do (2), a lot of students simply do the first 8 and then stop.