Standing in Synagogue

Question
What is the reason that we stand on erev Shabbos for mizmor L’dovid?
Also why do we stand for Oleinu?

Answer
There is no hova (requirement) to stand when saying any mizmor from T’hilim; this applies to the mizmor you mention which we recite on ‘Erev Shabath, as well as to any pereq from T’hilim on any other occasion. I am not implying that it is not a hova but is nevertheless a misswa. I mean that it makes no difference if one stands or sits.
The recitation of Mizmor Shir l’Yom HaShabath, like any Mizmor Shel Yom, is not a hova. It is an ancient and beautiful minhagh (see M’sekheth Soph’rim 18:1-2) based on what was recited in the Miqdash by the L’wiyim (see end of Mishna Tamidh). The fact that it is not mentioned in the Tur (OH 267) or in Sidure Hakhme Ashk’naz indicates that it is a later minhagh.
Reciting ‘Alenu at the conclusion of a minyan is also a minhagh, which the Tur (OH 133) does mention. Both reciting it and standing whilst so doing is not a hova, despite what the Rama writes (OH 133:2) in the name of the Kol Bo.
Nevertheless, in a minyan where everyone stands one should not remain seated. Even though it really shouldn’t concern anyone, the fact is that it does, and the Hakhamim teach us that in public one should not act differently from the community so as not to cause
mahloqeth.
Rabbi David Bar-Hayim