I already posted what I think is best to do in this situation, but I wanted to add some stuff.
Attending a baby shower for an unwed mother isn't condoning or supporting the sin that caused the baby. It's not like you were there during the conception, cheering.
Right, yeah, super awkward.
I also don't think that this should be about you approving of or agreeing with her choices, either. By making a big deal out of not attending the baby shower, you're making the whole thing about you, and it screams "Look how righteous I am, avoiding even the appearance of evil, shunning this fornicator. Pat me on the back for choosing better than she did." Those aren't the words you've said, but it is the attitude people are reading behind your words. I don't think you intend to come across like that, but that's how it sounds.
Why not, instead, GO to the baby shower, and help this girl celebrate her future with her child, and forgive her past?