But afterwards, it helps you to understand that kind of thinking and how to proceed to the next problem. At least it's way better than being pessimistic.
From a psychological view, I guess it has also something to do with how they were raised up until now and how they experienced things and saw the surroundings also by their parent's eye, but I believe that it is possible to change this kind of view. I was a pessimist until I started going to university.