To repel invading Arab Muslims, who had already sacked the little city in 846, and looted and burned Old St. Peter’s, St. Paul’s-Outside-the-Walls, and much else.
I guess the saint was not only against open borders, he was a racist, a xenophobe, an Islamophobe, a discriminator, and an opponent of diversity. Instead of building the wall, he should have simply said, “Who am I to judge?”