Is it ethical for departments to have publication requirements for students This question and this question suggest that it is not uncommon/unheard of for departments to require publication by students (generally masters and doctoral) either to get credit for a course or graduate. 

This seems to me like a way of off loading the assessment of students to peer reviewer, and therefore it seems ethically questionable. Is there a pedagogical reason to require externally peer-reviewed publication?
For an individual course (assuming a time-limited scenario, e.g. a semester, quarter, or even year), it's certainly ridiculous to have a publication requirement.  The timing is far too variable, and even the best researchers can have papers rejected or discover before submission that they've been scooped.  If it were possible to reliably publish a worthwhile paper within the timespan and amount of effort required for a typical course, then there would be a lot more papers published.

A requirement of submission is not as absurd, but still unreasonable.  I see no advantages over a mock submission sent to the professor teaching the course, but there are severe disadvantages: it can put pressure on students to make inappropriate submissions, and it can waste the time of editors and reviewers on submissions that may be withdrawn once the course requirements are complete.  My cynical interpretation is that submission requirements deliberately use the threat of professional embarrassment to encourage students to work harder, and that seems unethical.

The one scenario where publication requirements can make sense is for a degree program.  For example, some PhD programs require that a dissertation must be based on peer-reviewed publications.  Of course that's reasonable only in fields with a sufficiently rapid publication cycle, and even there I'm not fond of this idea personally (but I wouldn't call it unethical).