Registering as a Republican or Democrat doesn't necessarily say that much about your political affiliation in Pennsylvania. As I understand it, if you want to vote in a primary, you have to be a registered member of the party in question. So I expect for a lot of people, their registration is based less on their preferred party and more about which primary they want to vote on. I've voted in primaries where I had no intention to vote for any of the candidates in that primary in the general election simply on the theory that I'd want the least bad one to win the primary so if they won the general election it would be a better person.
One possible issue with this is that the area where he lived seems to have leaned considerably Democrat, so there wouldn't be much reason to for legislative races register as a Republican in his area, because the Democrats would win the general elections (making the primaries the only ones that matter). On the other hand, it might have been done with the goal of voting in statewide primaries (governor, Senator, president).