It's not illegal to share your name, however we do not advise that. On the other hand, sharing information about other people, especially without their permission, is not allowed.
Names, along with many other things, are considered as personal information. If such information gets to the wrong hands, there might be severe consequences.
Because of the possible security issues and a person's right to privacy, we can't tolerate such things.
When it comes to your facebook account and those contests, they do not break the rules, since people are willing to share it themselves.
Since all you have to do is comment, changing your privacy settings is enough, but as Mary said, your picture will still be visible. The other option is to create another account, which doesn't have your full name, pictures etc.