I think restrictions on homework questions should not be any different than restrictions on any other question. It's preferable that they include the restriction in the question, but I don't think people should ignore restrictions. If a question does have a restriction but it is not in the question body, then it should probably be edited in to state this.
If I ask a question for solving a problem, but I cannot use a certain technology, then a best solution that uses that technology really isn't useful to me or anyone else who is similar restricted. Homework questions shouldn't be exempt from this kind of respect. Once the question asker has established the presence of a restriction, it really is bad taste to promote something which they are barred from using (as opposed to if they were just looking for alternatives).
With Regards to Arbitrary or Poor-Design-Imposing Restrictions
A restriction being arbitrary versus practical should not affect your choice to respect it: the user still has to deal with the restriction. You might be able to argue against your employer's arbitrary restriction of useful tools, but at the end of the day he still commands your paycheck, not unlike the teacher who commands your grades. So you should honor arbitrary restrictions the same as you do any other restriction.
Let's expand an example on homework questions with restrictions. Suppose Alice has a homework question about implementing a certain function in Java. She posts it without a restriction at first, but then is told that there is some wacky restriction that her teacher has enforced which prevents her from solving it in O(n) time. So she edits her question, changing absolutely none of the content except for stating that she is restricted from using this method that would be faster. If you compare the two questions, the presence of the restriction doesn't really change the nature of the question, all it does is change what is a viable answer. Whether it is a good homework question (see some guidelines) that should be answered does not change from this. So the fact that a question with arbitrary restrictions is a homework question should not affect how you honor the restriction.
Bob is free to answer Alice's question stating the method which would solve it in O(n) time, provided he also gives the method which respects the restriction. If he didn't know how to solve it with the restriction in place, he can place it as a comment to Alice's question. There, people who come to the question will still see that the restriction is arbitrary and Alice's teacher is mean, and Alice doesn't have to deal with a useless answer. Learning is good, but never forget that the ultimate purpose of the site is to solve problems.