On the surface, the pregnancy itself wasn't totally unexpected. Since her one-night-stand with Pete Campbell earlier in the season and thanks to a constant weight gain in the following episodes, the speculation has always been that Peggy (Elisabeth Moss, underappreciated amongst the excellence in Mad Men) could indeed be preggers.
Is an unknown pregnancy is even possible? Well, of course it is. It doesn't happen often nowadays (without any empirical data to back this up, I'm sure it was a lot more common in the 50s and 60s, much like coat hanger abortions were), but it does happen. A cursory Google search can lead to more than a few examples and qualifications, two of which you can read for yourself here and here.
I had long been in the camp that Peggy should definitely not be pregnant. I felt that, like Pete blackmailing Don, a Peggy pregnancy would be the arc of a completely chalk television show, something which Mad Men clearly is not. But, like the blackmail arc which was diffused with a simple "who cares," the ultimate way her pregnancy was handled was beautiful.
Peggy is a girl who had never been to a gynecologist before the first episode. She had never been on birth control. It is entirely possible that she really didn't have any clue as to what the signs of a pregnancy are. Or maybe she just didn't believe that she could even get pregnant since she was on the magic pill that is birth control--something she even verbalized to her doctor as she was going into labor ("it's not possible"). But honestly, whether she really knew she was pregnant or not is almost irrelevant. Worrying about that is getting caught up in the particulars and not concentrating on the larger meaning for the series.
No matter what the scenario, of course Peggy would be in denial about her own pregnancy. She's been exposed as a person who is in denial about almost all aspects of her life. Look at the way she handled her dalliance with Pete, her air of entitlement around Sterling Cooper and even her babe-in-the-woods routine that she put on in Don's office during the penultimate episode (the "I try to be good" speech). Peggy sees everything through the rose colored glasses of her choice, trying desperately to fit into the world of Manhattanites. But as her outerborough date told her a few weeks back, and I'm paraphrasing here, "you might walk in their world, but you're definitely not a part of it."
From a pure narrative standpoint, giving her a child knocks Peggy back to earth the way that nothing else could. The rose colored glasses have been shattered. Now she's going to either have to give the kid away and face the consequences of conscience OR join the rest of her co-workers in living a life that's a total lie by raising the boy in anonymity.
In the end, I think that's the best possible character choice for her, much more demonic than simple physical weight gain because of the pressures of living and working in a man's world. If she wasn't a part of the Sterling Cooper world before, she certainly is now. Peggy will now become a full fledged member of the family of misfit toys--damaged, self-diluted and hidden behind a wall of lies like everyone else. She's no longer a square peg dying to squeeze into a round hole. The birth was like her rite of passage. It accomplishes for Peggy what not even a promotion to Junior Copywriter could--it allows her to finally belong.