“Trump won every single county in PA, therefore he won all the congressional districts. Most of these delegates had pledged to vote for whoever won their district. So, Trump should actually get all 71 delegates.”
I agree with that. He should get all 71 delegates.
In a perfect world Trump should get all 71, but Pennsylvania is not a perfect world.
Even though Trump won every county and all 18 districts, there were three delegates pledged to Cruz that won. One the 6th district, one in the 12th, and one in the 16th.
How could this happen? Well, when you vote, you select your presidential candidate, and you also select three of the delegate candidates. If you were given a list by the Trump campaign, you could select the ones who had indicated they would vote for Trump, or for the district winner. Apparently, not everyone had the list, or there were not enough favorable delegate candidates to pick three favorable ones.
Some delegates remain uncommitted, and yet won. Again, this is an indication that something went wrong, since ideally, Trump voter would have also voted for three Trump delegates or district winner delegates.