I think people are arguing 2 different things here. Docbot is arguing that, the rules are rules, no matter how stupid or daft they are, and so the consequence's for breaking them are justified seeing as there rules in the first place.
Most other people are arguing that, the rule is so stupid that It shouldn't be there in the first place. I am personally inclined to say that I agree with everyone else in the sense that it is a rediculous rule to have. A child should be aloud to invite whoever they want to their birthday party - so long as he has good reason for it - In the class or out the class.
I don't know how they work it in Sweden, however when I was at primary school I didn't have everyone's phone number, or address, and If I suggested to my parents that we get everyone's address/phone no from public listings they would say "Don't be bloody rediculous, hand them out at school"
However I do also see the fact that rules are rules, and the teacher is only doing his job. Maybe the fact that this has went public will make the school review it's rules on the subject.