There are many reasons why a person ends up being alone. Some of them are negative, and some are positive, and some are accidental, and some of these choices happened accidentally on purpose. Sometimes you make choices to do what you think you want to do, and only later find out that you've inadvertently chosen to do it all by yourself after you're entirely committed. If you think about how long it takes to get exactly what you want, how long people work to set themselves up for retirement - it's a long haul. Most people don't know what they're going to do with themselves when they retire because they never had a chance to do what they loved to do - or they're not able to reinvent themselves.
Sometimes it is just that we cannot "sell" our desire to have things the way we want to anyone else who wants share that situation with us. Or sometimes, we end up alone because there is something we do that is not socially acceptable to others who would usually want to hang out with us. I am overwhelmed with how many of my peers become alcoholic as they age, somewhat because "it doesn't matter now." Some people go through a process of "giving up" (sometimes necessary) without ever coming out on the other side of it to understand what they do want. Some just decide not to learn anything new and get along with what they have because it's just too much trouble to feel like you don't know what you're doing. This is an example of circumstantial isolation.
Relationships teach you about yourself. (Or, at least that is how they have always worked for me.) In a way, it's expending less effort to be alone. All those character defects that are irritating to someone else don't matter when you're alone - nobody else is there to accept the consequence except you. If you're OK with it, you can have things be any way you want, and some people get very "set in their ways." You don't have to explain the way you are, how you work, why you do what do because there is nobody to answer to. Being alone is both an advantage, and a disadvantage.
Something else that Linda mentioned I think is a much bigger factor than she lightly skipped over. Never underestimate the power of a significant booby prize that is the strangest feature of being lucky enough to get old. Watching those twenty, thirty, forty year friendships dissolve or suddenly disappear is not for sissies.
Someone asked an old woman past 100 what is the best part of being old - and she said, "No peer pressure."
I don't know what your experience with death and the process of grieving is, but in my peer group - people do not want to hang around someone who is grieving. Oh, after someone dies, people will gather to console one another and commemorate, but then they
go away. They don't call, they don't make contact again for another...three months or so. Then it's only a light check-in. Somehow you're supposed to "get over it" or "deal with it."
People get tired of hearing about how you feel. This distaste partly reminds them of how they cannot accept their own death, or how unpleasant it is being the one who is left after best friends and lovers are gone. There isn't much social support for accepting each person's unique process of going through their own grief. Instead of recognizing that grief is a special time, people call it "depression." It's not depression, it's grieving - but this is the cloak society wraps it in.