This is never elaborated on in the movies, nor can I find any explicit interview that answers this question.
However, Legolas is royalty (as the prince of the Woodland Realm), so it would make sense for the Elven troops to acknowledge him; at least more so than Aragorn, who at this point is not yet widely known nor treated as having any royal importance).
Secondly, it may be a matter of marching protocol that the troops only turn once all of them have come to a halt (for the same reason why armies march in sync and stick to formations - to convey the image of a well oiled machine).
When Haldir starts speaking, the troops are still marching. The troops behind Haldir did halt earlier than when they turn to face left; but it's possible the troops in the back were still filing in (we don't see them on screen), and the elves only turned when all troops were halted.
Paulie_D may also be right that the elves' response may be related to Haldir speaking to Theoden (i.e. the order of business), rather than Haldir having just greeted Legolas (i.e. a personal interaction).