This has less to do with Pennsylvania in particular and more to do with national shifts. It's not that Pennsyvlania changed fundamentally (though there was definitely a move towards the Democratics within the state as the political machines took over the once Republican city of Philly) but that the South swung hugely to the Republicans in the 1950s as their Hero FDR was replaced by the uninspiring Adlai Stevenson. This made Pennsylvania a Democratic leaning state in terms of the national vote.
Then why did other Northeastern states swing so much more?
I think it was mostly the Democratic takeover of the Philly city government. IIRC, Dewey almost carried the city in 1948.