There are three main reasons for the different treatment of malls and restaurants, the physical nature of the spaces, the behavior of the people and the activities engaged.
Malls are huge. They have a lot of air and big, active ventilation systems. Virus particles are diluted by all the air in the space and do not accumulate because the ventilation is so good. Because malls are always large corporations, they have better maintenance and equipment.
Restaurants are not huge. They often have lame ventilation systems and, because many of them are tiny corporations, they are often not well maintained. Particles have been well proven to accumulate.
People visit malls for relatively short periods of time and they are moving the whole time. This means that, even if there are a lot of particles in some spot, the fact that you are only there for a minute means you don't have time to breath in very many.
People sit in restaurants for hours, in one spot. If there are any particles nearby, you are there long enough to make sure to breath them all.
People barely talk in malls and, in decent places, they are masked when they do. Talking (singing, shouting, and otherwise using your breath) significantly increases the amount of particles emitted.
The only thing to do in a restaurant is talk except when eating. The fact that you have to take off your mask to eat makes the fact that you are doing a maximum particle activity even worse.
Which is to say, it *does* make sense to close restaurants and open malls.