Is it fair to punish absent students with a one-question exam? I recently came across a post (that I won't disclose because it contains the professor's last name):

Attendance in this course was regularly low, so the professor used a one-question exam to punish students who weren't attending a class. Those who weren't in class would have obviously failed this exam, and those who were in class (presumably) would have all gotten A's. The final remark on the note on the door was "maybe we'll do this again some time".

Let's assume a few factors about the course and this one-question exam, since we don't actually know how they're implemented:


The course has an attendance policy (3 days max missed before your grade starts dropping, for example)
This one-question exam has an impact equivalent to a homework assignment (could drop your overall grade by 1% if you get a 0).
By the language of the original post, this is not something the students would have expected to happen; this means that the policy would not be outlined in the syllabus.


What if the course didn't have an attendance policy and the professor is simply annoyed that students aren't attending the class? What if this one-question exam was only worth a point or two instead of a whole homework grade?

Is it fair (ethical, if you will) to use this kind of tactic to impose additional punishment on students who don't attend lecture?

Clarification: Students who are absent (if intentional, extraneous circumstances aside) deserve to lose the points for the work they missed. However, this tactic is being used to additionally punish students solely for being absent; this is also why I posed different assumptions about attendance policy.
I think that this is unprofessional, and is leaving the institution open to all sorts of action (up to and including legal proceedings, if it impacts on a student's progression, for example). For example, what if a student is unavoidably absent? 

If it's only "worth a point or two", then I don't think it's worth antagonising people in this way. The sarcastic note left on the door simply underlines how poorly thought-out this whole thing was...