Homework works. If it is done right. In my experience, this is what typically occurs:
Since homework is so ubiquitous, it is imperative that homework be done correctly. If not done correctly, it might as well not be done.
Extrinsic rewards (points) is the main motivator for doing homework. This is dangerous, since relying on points alone results in some bad habits. Homework is done for completion rather than comprehension of the material. Cheating or finding answers online is emphasized. It doesn't really help that parents typically support the end (points, grades) rather than the means to that end. Students can develop poor value judgments from years of this type of behavior. Almost always, the best chance to increase grades is to study for tests rather than completing busywork. But since studying often doesn't directly come with point rewards, it is not done and grades suffer.
Students should be encouraged to do homework for attainment value (the value of mastering a material). Preferably, the homework should be monitored for mastery rather than completion. Less emphasis should be placed on the grades. This is difficult, since grades often provide a fast reference for competency.
Homework is varied. A simple way to determine whether or not homework is done correctly is to consider the cognitive load of the task. Cognitive load refers to the mental strain that one encounters when working on a task. Typically, more cognitive load corresponds to increased learning. One thing to note is that time on task is not an indicator of learning. You can spend hours on a task but not learn a thing.
Homework is motivated by several extrinsic factors. Some rewards are points, grade increases, which lead to parental approval and freedom to do leisure activities. This leads to associations between homework and reward. Homework should ideally be done for achievement and mastery. A student's own intentions, free of influence, should be the sole determinant for doing an activity.
Avoid rewarding homework completion or grade achievements if possible. Similarly, don't punish the lack of completion or poor grades with a removal of freedom (you don't get to do this now).
Homework should be done properly and not simply for completion or minimum work necessary for the highest marks. Many systems in place reward homework completion, which unfortunately, results in poor learning.
Homework should be treated seriously to improve performance in a class. When homework is done incorrectly, it is simply a waste of time.