People - everyone, including you and me - don’t think before most of their acts. And a lot of bad habits boils down to conditioning or lack of.
That’s likely the case for littering: they do it without thinking, justification, or reasoning. “I got some trash, I don’t want it, so I throw it on the ground.”