Pillagers in Minecraft will spawn around Outposts. Generally, they’ll spawn every few hundred chunks, making them quite rare. Due to them being a structure, they have some different spawning rules when it comes to mobs.

Unfortunately, even after clearing a Pillager Outpost, Pillagers are able to continuously spawn nearby. Even if the player is inside the Tower. There’s only a few remedies, and none of them are quick and easy.
Base Building
Before getting started, stopping Pillagers from spawning isn’t an easy task. If you haven’t yet built a base near an Outpost, but are contemplating it, then I recommend that you don’t.

Instead, maybe try building an Outpost of your own, as it’s such a simple design. However, if you definitely need to prevent the spawning of Pillagers, then check some of the steps you can follow below.
Spawn Rules
In Minecraft Java Edition, Pillagers will spawn around an Outpost, in a radius of 74x52x72. Their spawn rules indicate that Pillager-themed mobs are only able to spawn as long as the light level of a block is 8 or lower. However, they’re able to spawn on Grass Blocks and Sand Blocks regardless of the light level.
That leaves us in a tricky situation. Even if you light up a huge area around the Pillager Outpost, Pillagers are still able to spawn, annoyingly.
Therefor, the only method of stopping Pillagers from spawning in Minecraft is to replace all nearby Grass Blocks and Sand Blocks. This has to be in a radius of around 74 blocks in each direction.

That’s the first step completed. But Pillagers are still able to spawn, as long as the light level is below 8. This mechanic is what’s seen on other hostile mobs, like Creepers, Zombies and Skeletons.
Make sure to then light up the area around the Pillager Outpost, with items like Torches, Lanterns or Glowstone. When all that’s done, Pillagers should no longer spawn at an Outpost. It’s not the quickest method, but it doesn’t require any cheats.
For extra security, you can place down blocks that mobs usually can’t spawn on. This includes Glass, Leaves and Slabs.
Command Blocks
Another method is to simply kill Pillagers as soon as they spawn, which can be done with Command Blocks. This does involve cheating in a way, as Command Blocks are unobtainable in Minecrafts survival mode.
If you don’t have access to cheats or commands, you’ll need to press Escape > Open to LAN, Allow Cheats > On and then press the Start LAN World button. To give yourself a Command Block, enter the following command in the chat: /give @p command_block

Place the Command Block inside the Pillager Outpost, so it’s in the center of the area that Pillagers can spawn in. Right click it to open the window, and paste the following command into the text box: /kill @e[type=pillager,distance=..100]
Finally, in the Command Block, make sure the far left button which says ‘Impulse’ is switched to ‘Repeat’. That way, the command will constantly repeat itself. Set the right button to ‘Always Active’ too, so that no Redstone is required.
This command will kill any Pillagers within 100 blocks of the Command Block, so that value can be changed to one of your choosing. If you want to disable the Command Block spam, then enter the following command in the game chat: /gamerule commandBlockOutput false
Notes & Alternatives
Blowing up a Pillager Outpost will make no difference to the spawning of Pillagers. Neither will surrounding it with Lava, or just lighting it up. Pillagers will always be able to spawn on the surrounding Grass and Sand Blocks, so these need to be removed.
There are some alternative options. One just being to simply move away from a Pillager Outpost, to a different Biome. Hordes of Iron Golems can be setup to try and defeat any that spawn. Or even surrounding an Outpost with Fences to stop any Pillagers from escaping the surrounding areas.