Many people wear the sunglasses now just for the cool appearance. As the good accessory, the sunglasses will be matched with your clothes to make you look so cool. Some people wear the sunglasses at graduation just for cool to show their personality. If you go out in the sun, you'd better wear the sunglasses to prevent from the uv.
Well, it seems that you are really wondering why they choose to wear sunglasses upon their graduation ceremony. So, I wonder if the day you met them was a hot and sun shining day. If so, their purpose was to better protect their eyes because sunglasses could help us resist some harmful lights. If not, then maybe it is just their habit to do so. Anyway, maybe they wanted to be cool by wearing sunglasses in public.
They maybe just want to look cool at graduation ceremony, that that might be the main reason. But I can still list lots of reason for you. First of all, they may want to avoid the sunshine, you know that in most cases the ceremony will hold in an open place. Another reason might be their disguise for the eye disease. By the way, the may just want to hide their real feeling of graduation. They don't want other people see their sentiment.