Hagg was selected by the Philadelphia Flyers in the second round (No. 41) of the 2013 NHL Draft after his first season with Modo of the Swedish Hockey League.
On March 21, 2014, Hagg signed an entry-level contract with the Flyers and joined Adirondack of the American Hockey League, where he had four points (one goal, three assists) in 10 games. The Flyers moved their AHL team to Lehigh Valley in the 2014-15 season and the defenseman spent most of the next three seasons there. He was called up by the Flyers on April 9, 2017 and made his debut that night in Philadelphia's regular-season finale against the Carolina Hurricanes.