By rule, when a field goal is missed, the ball is placed at the spot of the kick, not at the line of scrimmage at which the ball snapped for the field goal attempt. But if the miss happens from within the 20 yards of the end zone, the ball will be placed at the 20 yard line.
From the NFL rulebook:
All field goals attempted (kicker) and missed from beyond the 20-yard line will result in the defensive team taking possession of the ball at the spot of the kick. On any field goal attempted and missed where the spot of the kick is on or inside the 20-yard line, ball will revert to defensive team at the 20-yard line.
The Patriots drove to Eagles' 8 yard line. After the snap, the ball is placed 8 yards behind the line of scrimmage for the kick attempt. This means that the ball was on the 16 yard line on the field goal attempt. The attempt was a miss and inside the red zone (20 yard line), Philadelphia gets the ball on their 20 yard line.
As for your comment on the question, the end zone is 10 yards deep and is added to the line the ball is kicked from to measure the length of the field goal attempt. So Stephen Gostkowski had a 10 + 16 = 26 yards attempt.