Why does an unpluged egr valve run better then

It sounds like the EGR pintel valve is open with this vacuum line connected. There should be no vacuum to the valve at idle(pintel should be seated) perhaps the line in connected to an incorrect source.

A engine without mechanical defects (not yours) and a properly configured and operating EGR system will not cause a car to ping.

I answer this post as part of my effort to convince the public that keeping current emmission equipment in good order is not harmful to the auto. The idea that emmission equipment does nothing but harmful things came about with early techniques and the impression has been passed on through generations of mechanics and DIYers