I guess I see your point. After all, did he check to see if anything else that you were legally posessing was stolen (other than your car)?
If you had a laptop, I bet they wouldn't try to see if that was stolen unless they had a reason to, so why the gun? It seems to me that the most dangerous time for the officer was before he knew you had a gun, if for example, you were a fugitive or nuts or some other type of dangerous dude. You started out with a loaded gun and didn't shoot him before he knew you had it, so why not just give it back. At that point, you were home free, so you would have had no reason to shoot him.
So you had to leave your car on the side of 95 to get your gun out of your trunk and endanger your life? Maybe to further ensure the safety of police, when pulled over we should be required to throw anything dangerous (guns, knives, nail clippers) out the window, then strip stark naked and spread eagle on the ground. Yeah, that's a little extreme, but my point is we have a right to bear arms, and we shouldn't have to give that up (or get out of our car on the side of a busy highway) when there has not even been a suspicion of a crime or suspicious behavior. At what point are we being put upon to "increase officer safety"?
Chalk it up to the little losses of freedom that we've come to perceive as normal. I live in PA too, and I think we have it pretty easy overall. That officer might not have been comfortable with guns, as many folks who grew up around Philly didn't grow up with guns.