Niall Canavan put the Iron in front in the first half in his first start for the club, but Stephen Dobbie's later equaliser took the game into extra-time.
Swans skipper Garry Monk was dismissed for a headbutt four minutes from time and the visitors took advantage when striker Hooper scored from the spot after 111 minutes.
The Welsh side then lost their discipline at the death when Gorka Pintado was dismissed for a second bookable offence and Angel Rangel saw red for violent conduct.
Paulo Sousa's side ended the game with six men when Dobbie and Besian Idrizaj were unable to continue after suffering injuries on a forgettable evening for the home side.
Scunthorpe took the lead after 12 minutes when Josh Wright's cross was turned in by Canavan from close range for his first goal in senior football.
Swansea goalkeeper David Cornell, making his competitive debut for the club, then produced an excellent save to keep out Martyn Woolford's shot from 12 yards out.
Sousa brought on Dobbie at the interval and the striker was in the thick of the action straight away when he shot wide from inside the area.
Dobbie looked lively in the Swansea attack and he was unlucky not to draw his side level when his left-foot finish rattled the crossbar 15 minutes from time.
But the summer signing from Queen of the South was celebrating three minutes later when he produced a clinical right-foot finish from 20 yards out that flashed past Joe Murphy.
However, Swansea were left with an uphill task when Monk was sent off after 85 minutes for a headbutt on substitute Michael O'Connor.
The visitors made their numerical advantage count when Alan Tate handled in the area and Hooper made no mistake with the resulting spot-kick early in the second half of extra-time.
Swansea then lost their discipline and Pintado was sent off six minutes from time before Rangel saw red two minutes later for violent conduct.
And the home side played out the last moments of the game with six men after Dobbie and Idrizaj came off due to injuries.