When a homework question is asked, as long as someone is willing to answer it, the questioner gets what he came for, and it provides incentive for him to ask even more homework questions. All it takes is one "defector." This is complicated by the fact that there can be a difference of opinion as to whether something is homework, and again, once one person decides a question is not homework and answers it, the restraint among the remaining members is for naught.
We have a couple options, for example:
We could not to worry about helping with homework, as the ethical violation is mostly on the person asking the question, not the person answering. We would still close non-research questions, but not worry about someone answering homeworks. The problem with that approach (in addition to helping people cheat) is that we might incentivize a flood of questions that will have to be closed.
We could have moderators constantly monitoring the site and aggressively closing/deleting questions they believe to be homework. The downsides of this is that we'd need more moderators and that we'd get lots of false positives. This might discourage new people from asking questions in the first place.
I don't know if this is possible, but perhaps if enough high-rep users decide a question is homework, anyone answering it gets a reputation penalty. This would require a change in site mechanics (probably not possible) and also have the downside of making people weary of answering even legitimate questions. Perhaps this can get implemented by an ethic of downvoting such answers, but I am not sure I like where this would go.
More worrying is that once a professor becomes creative with homework problems, and assigns harder or non-standard questions, we would not be able to recognize them as homework. I've had professors give homework problems that would easily pass as a legitimate questions on this site. There's not much I can think of to deal with this problem, except perhaps have this site become sufficiently well-known, so that profs are aware of this potential "resource" for students.