Based on the stains on the floor I'm gonna guess this was a recent install.
There's nothing worse than excusing yourself to the bathroom only to come back with the front of your legs sprinkled with urine. Actually, that's not true -- trailing toilet paper out the back of your pants is worse, which is why you should never leave the house without going #2. So yeah, this is a urinal splash guard that prevents your lower legs from getting hosed with rogue urine. Your upper legs? They're still on their own. If they get sprayed I suggest splattering some water from the sink on the front of your pants and pretending you're a spazzy hand-washer. *eyeballing pants* WHICH I AM.
Thanks to Kenny, who tried to tell me that the guard is actually to prevent piss on the floor and not your legs. Pfft, who cares about the floor?! He also tried to tell me the black spot at the top was a headrest.