I'm guessing you mean, why was the first task repaired before Scorpius went back to repair the second task (which the audience doesn't see)? It's more practical from a staging standpoint. It looks more impressive for Scorpius to come out of the water and nervously wait to see if Albus will come out of the lake, than for both to suddenly be standing there in the middle of the forest, eliminating any tension from the scene.
As for the reason in terms of plot, there are two, one of which is explicitly stated by Hermione. She cannot go outside because the Dementors will detect her. The plan was turn time in the hideout in the Whomping Willow, near the site of the first task. Since there would be no Dementors present in the past, they could repair the first task and then return to the hideout in time for the time turner to return them to the "present." They would then turn time in the hideout, once again allowing them to avoid the Dementors, and repair the second task. ***EDIT: they also don't need the additional time to return to the hideout, since the original and true timeline would be restored, putting just Albus and Scorpius in the lake.
The second reason is that by repairing the second task first, Scorpius and a restored Albus would be left alone to repair the first task. Repairing the second task first would restore the first alternate timeline, so Snape would be dead, and Ron and Hermione would be in the forest with Harry as part of the search party for Albus and Scorpius. There is no reason to think that would not be discovered before attempting to repair the first task.