The Bianconeri were hoping to avoid going five games without a victory at the start of an Italian top-flight season for the first time since 1955-1956, and they started well at Stadio Alberto Picco, Moise Kean putting them ahead before the half-hour mark.
Spezia responded in barnstorming fashion, though, and went ahead thanks to goals from Emmanuel Gyasi and Janis Antiste.
Juve, which had picked up just two points from its opening four games, ensured a first victory of the domestic campaign, however, through the impressive Federico Chiesa and Matthijs de Ligt.
Victory will ensure some time out of the spotlight for Juve's under-fire players, but Allegri suggested he will not be going easy on them.
"Luckily we won a match while suffering," he said. "Otherwise we might have thought we did well and there was nothing more to do.
"There are many things to improve. We have players who must do better in their decisions of the last pass, when to shoot on the target.
"Today we won an important match. We have to get out of the comfort zone, football is made up of suffering and fatigue.
"We don't have to look at the table. We try to put our first win next to the first at home against Sampdoria (this weekend).
"There are players who have important qualities and who need to improve.
"[Weston] McKennie, for example, should have scored at least four goals and those chances make the difference."
While Juve impressed in attack, taking a whopping 25 shots, it looked anything but secure at the back.
It has now conceded in its last 19 league games, while it is only the second time in the past 60 seasons it has let in eight goals in its first five Serie A games.
De Ligt acknowledged that he needs to improve, while the Netherlands international hopes a first win of the season will act as a springboard for Juve to climb the table.
"I always need to improve," he said. "It's normal to receive criticism. I have had a lot, for me it's not that important. I just have to work to improve.
"At Juventus we have to win all the games. Now we must start a new championship with these three points.
"Game after game, we will see how it will be. I'm happy with the points won today. We always play together, those on the pitch and those on the bench and it's very important.
"Even those who entered in the second half did very well."