Snape and Lucius were old friends.
As I learned from this excellent answer on another SE site, there was more to the relationship between Severus Snape and Lucius Malfoy than just both of them having been Death Eaters and the former favouritising the latter's son for years.
From Snape's very first day at Hogwarts:
And Severus Snape moved off to the other side of the Hall, away from Lily, to where the Slytherins were cheering him, to where Lucius Malfoy, a prefect badge gleaming upon his chest, patted Snape on the back as he sat down beside him ...
-- HP and the Deathly Hallows, "The Prince's Tale"
Narcissa also refers to them as old friends:
"Severus ... please ... You are, you have always been, Draco's favorite teacher ... You are Lucius's old friend ... I beg you ... You are the Dark Lord's favorite, his most trusted advisor .. Will you speak to him ... persuade him."
-- HP and the Half-Blood Prince, "Spinner's End"
And Sirius, admittedly in full taunt mode, calls Snape Lucius's "lapdog":
"Tell me, how is Lucius Malfoy these days? I expect he's delighted that his lapdog's working at Hogwarts, isn't he?"
-- HP and the Order of the Phoenix, "Occlumency"
None of these quotes is really conclusive on its own, but taken together they point towards Snape having been a friend, perhaps even something of a protege, to Lucius during their Hogwarts years. To an unpopular boy from a poor background like Snape, any encouragement from a rich prefect like Lucius could have meant a lot.
Moving forwards to the time of HP and the Goblet of Fire, how is the relationship between the two now? Snape defected away from the Death Eaters at the end of the First Wizarding War, but presumably Lucius doesn't know that, and there's no reason why Snape would automatically hate all his old Death Eater friends just because he betrayed their leader who killed the woman he loved. It's quite possible that Snape and Lucius had continued to have a cordial friendship through all the intervening years.
Then, why the sudden movement? Surely Snape must have known that Lucius would still be a committed Death Eater when Voldemort returned, and therefore the two would be on opposite sides in the upcoming conflict. But it seems to be an involuntary reaction, so rationalisations like this don't necessarily work, even for such an accomplished Occlumens (implying immense self-control) as Snape. His thoughts might have been "oh no, my old friend's going to be an enemy! ... meh, I guess I should have known that". Or he might have hoped that Lucius wouldn't want to risk his cushy job and power at the Ministry for the chance of a different kind of power under a returning Voldemort.