Why can't temples stop ghosts?

You said yourself that what you saw in the film and television works was artificial and untrue.

Real temples are places where buddhas and bodhisattvas are located. Numerous protectors will never let demons make trouble.

But outside the temple, there are indeed many ghosts, and it is estimated that most of them are wandering ghosts, because these people are not free and are very painful. They also want to worship Buddha and recite scriptures in the temple, hoping to get over it as soon as possible, get rid of ghosts and get rid of suffering (ghosts are extremely bitter). Because there are protectors at ordinary times, I can't get in, just outside the temple. If the temple gives food or practices, they will get manna and food, or get relief.