The Bluebirds had not won on any of their past 13 trips to Harrogate, but Spence’s spectacular first-half strike sealed maximum points, with goalkeeper Paul Farman saving Jack Muldoon’s penalty for the hosts after the break.
Spence, recruited in the summer from National League side Halifax, scored his second goal of the season in the 21st minute when he let fly with a 25-yard diagonal drive that whistled inside home keeper Mark Oxley’s right-hand post.
Harrogate’s most promising spell of the half came in stoppage time when Farman rushed out of his goal to smother a James Daly chance and then tipped Matty Foulds’ header around an upright.
But Town squandered their best chance of an equaliser when Rory Feely threw up an arm in the box and made contact with Anthony O’Connor’s header.
Muldoon was given the responsibility from 12 yards but his weak spot-kick down the middle of the goal was easily saved by Farman as Harrogate suffered a fifth defeat in six games.