The reason why people are putting cups under toilet seats is because it's used as a signal in public restrooms that there is not toilet paper in the toilet stall which prompts people going into that stall to seek another stall or restroom.
Seeing a red solo cup or a similar cup or object under the toilet seat in public restrooms is a common but often unspoken signal which signals that the stall is out of toilet paper.
The cup under the toilet seat also acts as a replacement for a toilet paper hub, which indicates to potential users of the toilet stall that it's not equipped with any toilet paper and they should go somewhere else.
Some people may also place a plastic cup under the toilet seat as a way to prevent the toilet seat from slamming down which can be disruptive to others in the household or to prevent damage to the toilet and toilet seat.
Pacing a cup under the toilet seat though is not really a good thing and is unsanitary and could spread germs when other people come into contact with it to remove it to set the toilet seat down.
Another reason that cups are placed under toilet seats is to indicate plumbing tests for leaks as some service technicians use this method to prevent water from escaping.