While other than practicality of keeping the sun and glare out, I’m guessing there could be two other reasons for this.
The shades give a sense of intimidation and mystery to the bodyguards.
Notice in the image below, how you would be interested and hoping you can go up and greet or shake hands with Obama, but would really want to steer clear of his security detail. I am sure they could be friendly and nice too off duty but there they are doing their job and doing it pretty well so far.
Second, if you, as a hitman/assassin were being suspicious, they could already be keeping an eye at you without you knowing, watching your every move.
If you could see their eyes looking towards you, you would abort and act casual, waiting to lose their attention.
But in the image above you are not sure if the two SS are just casually walking or already staring straight at you “Yeh, dude… go ahead.. TRY!”