I think a lot of autistics who are lonelier as they get older are those who didn't start out with a decent support system of friends and family when they were younger. As you age, if you didn't have too many connections to the world, the old ones age and die, or move away.
I wasn't lonely when I was younger, partly because I was living at home and my mom and I were close and that was enough for me. That and living in my own world.
It didn't help that my father, I strongly suspect, was also autistic. He was a loner, found being around people very exhausting. Even had trouble being around my mother and me. As a consequence, we were very isolated, didn't socialize much outside the house, except a few close relatives. Didn't have visitors, not even relatives after I was twelve or so when my father went into a deep depression. If they didn't see it, they could pretend it wasn't happening, and he was able to put on a show for them the few hours we went to their houses for Christmas, Fourth of July, etc.
When they died, I was alone except for my grandmother. Visits to her and my inner life sustained me for the next twenty years. Also, the last dozen years, the Internet has helped me find people with mutual interests and I made some online friends.
Then my grandmother died. Then an online friend I thought of as close as a brother (who told me that I was his "best" friend) dumped me after his life changed. The last few years I've been feeling lonely. I'd gotten out of my inner world and haven't been able to go back into it.
So I've been going out into the world a little more. An autism support group has been a help. I've been going to some meetups. And eventually I'm going to try to connect more with a few relatives I have remaining in the area.
I've found that trying to be close to people only makes me more lonely, because inevitably I don't find them interesting or someone I can relate to.
I feel that way too. Close friends are hard to find. Acquaintances aren't sufficient. With a close friend, there's a feeling of connection and happiness that isn't there with just anyone. It's harder for us autistics because to get a good friend (or a romantic partner), you really have to put yourself out in a lot of different places, meet a bunch of people. That increases your chances of finding people you feel an attraction to (friendship, not just romantic). And that's what we have real trouble doing.
Meetups are good. There are many groups depending on your location, and you can find people with somewhat mutual interests. I go to a weekly walk. It helps take away some of the loneliness, but it isn't sufficient. It's not a substitute for a good friend. I do have a little bit of a connection with one of my autism support group members, but that's complicated in part because we're both autistics. It's a little difficult for two people who have problems socializing to socialize without making a boo-boo. But that's another story.