The problem is getting an army of undead. If a level 20 wizard uses all their spell slots on reasserting Animate Dead every day, that's 128 skeletons. They'd presumably be untrained laborers making 2 sp a day, so it's 25.6 gp a day. You'd be the world's poorest level 20 wizard.
If you want a proper army, your options are having a whole bunch of necromancers, a Lich using its Lair Actions to regenerate spell slots, the Wand of Orcus, or using Finger of Death to murder people for years. And that last one only gets you zombies.
Edit: It's 142 skeletons if you're a necromancer wizard thanks to Undead Thrall giving you an extra pile of bones.