I think if someone tells you, "I got married!" and your first response is, "but what about me?" then it's rude. That's straightforward enough. If it's supposed to be a joke, then it needs to be made very clear, such as with a winky face or "jk lol" or something. If you ever need to explain that something was supposed to be a joke to a decent proportion of the people who hear/read it, then that alone determines that it wasn't a good joke.
If the person really had a beef about why they weren't invited, they more properly should have asked via private message, where they wouldn't make a tactless fool of themselves in public. Maybe they had a right to be upset, e.g. they had been promised to be invited (although it sounds like that couldn't have been the case here) or they were a close sibling or something. But that doesn't mean you should make this public. Issues like this should be dealt with in private. If I were a member of the couple, I'd just delete the comment and leave it at that. It's not worth losing sleep over another person's small lack of social awareness.
I don't think it should be considered rude to announce that you've gotten married on Facebook. That would just be silly. Most people, I imagine, would have more friends than they could possibly invite to a wedding, birthday, or any other event. Should we also refrain from mentioning our fun weekend at the beach with a couple of mates because it might offend other people? It's a bit over the top to criticise the bride here for making an acceptable post about getting married. I do, however, think telling people they're invited to a garden party and then surprising them with a wedding is a whole different kettle of fish, but that's unrelated to the Facebook thing.