A lot of people are self concious about doing things alone that they rarely see other people do alone. Media mocking it also plays a part.
In the case of restaurants, someone eating alone at a diner, especially at the counter, is really common. Even eating alone at a table in a diner is a common thing to see in person or in movies/tv.
Someone eating alone at a fancy restaurant or even a chain restaurant is less common in a lot of places and frequently used as a joke in movies and tv. The 'when will your guest arrive?' trope reintorces the expectation, and isn't uncommon in real life either. Self concious people refrain from doing it, people don't see others do it, and it becomes a reinforcing loop that happens in a lot of places, but certainly not everywhere.
I used to think it was unusual because of the social expectations, but notlw I frequently eat alone on business trips and don't think about it anymore. Yes, wait staff do frequently ask about who will be joining me and occasionally give weird looks when I say I'm eating alone. This is way less likely in larger cities.