Why couldn't Pepper put the electromagnet back into Tony's chest? Was it because it was contaminated?
The new unit appears to be a complete upgraded replacement for the old unit including the electromagnet that was at the end of the old one.
Tony Stark: This is what will be keeping me alive for the foreseeable future. I'm swapping it up for an upgraded unit.
The novelisation of the first two Iron Man films, Phase One: Iron Man, has a bit more detail on the matter here:
“That’s the thing that was keeping me alive,” he said. “It’s now an antique. This is what will be keeping me alive for the foreseeable future.” He held up a similar device that looked much more high-tech and powerful.
“Amazing,” she said.
“I’m going to swap them out and switch all functions to the new unit,” Tony said
Phase One: Iron Man
The last line is particularly telling, "all functions" which would presumably also include the electromagnet. Remember Tony/Yinsen built the first one in a cave with rudimentary tools. The new one was built by J.A.R.V.I.S. with the most high tech and up to date tools so was always going to be smaller and more efficient.
So she couldn't put it back in because Tony is just messing with her, he didn't want her to put it back in because she didn't need to, the new device was taking over completely from the old one.
It seems likely that Tony's intention was always to remove the old chestpiece including the crude electromagnet. The fact that he doesn't replace it strongly suggests that new magnet is much smaller and built directly into the new chestpiece (or the wire that extends into the cavity).
As to why he made such a big deal out of her pulling it out, it's because he's messing with her, telling her to do things, then making out that it's not what he intended. He already pulled the same joke a few seconds earlier when he's talking about Operation (pretending that she'd shocked him). He's trying to keep the situation light and stop her from panicking.