A draw would have been enough for the runaway leaders to secure an eight successive Scudetto and they looked set to do so after Moise Kean to put the visitors ahead in the 29th minute.
But SPAL struck back in the second half, with Kevin Bonifazi finding the net before Sergio Floccari scored to ensure the home side took the three points.
Juventus boss Massimiliano Allegri made nine changes to his starting line-up from the side which faced Ajax in the Champions League in midweek, with debutants Grigoris Kastanos and Paolo Gozzi among the starters.
SPAL started the brighter of the two sides, but Kean put Juventus ahead in the 29th minute with his sixth goal in as many matches. Joao Cancelo's shot deflected off the outstretched foot of the 19-year-old forward and into the left corner of the goal.
SPAL equalised four minutes into the second half when a Pasquale Schiattarella corner was headed in by Bonifazi past goalkeeper Mattia Perin.
The home side almost took the lead in the 57th minute when a cross from the found the head of Alessandro Murgia but his effort went straight into the hands of Perin.
Minutes after coming off the bench, Hans Nicolussi Caviglia saw a long-range swerving effort saved by SPAL goalkeeper Emiliano Viviano.
A clever touch and finish from inside the box by from SPAL's number 10 Floccari gave his side the lead in the 72nd minute just as Juventus had started to increase the pressure.
Juventus had a chance to equalise in stoppage time but full-back Mattia De Sciglio headed wide from a free-kick.