You can cast this spell only at night. Choose up to three corpses of Medium or Small Humanoids within range. Each one becomes a Ghoul under your control (see the Monster Manual for its stat block).
As a Bonus Action on each of your turns, you can mentally command any creature you animated with this spell if the creature is within 120 feet of you (if you control multiple creatures, you can command any of them at the same time, issuing the same command to them). You decide what action the creature will take and where it will move on its next turn, or you can issue a general command, such as to guard a particular place. If you issue no commands, the creature takes the Dodge action and moves only to avoid harm. Once given an order, the creature continues to follow the order until its task is complete.
The creature is under your control for 24 hours, after which it stops obeying any command you’ve given it. To maintain control of the creature for another 24 hours, you must cast this spell on the creature before the current 24-hour period ends. This use of the spell reasserts your control over up to three creatures you have animated with this spell rather than animating new ones.
Using a Higher-Level Spell Slot. If you use a level 7 spell slot, you can animate or reassert control over four Ghouls. If you use a level 8 spell slot, you can animate or reassert control over five Ghouls or two Ghasts or Wights. If you use a level 9 spell slot, you can animate or reassert control over six Ghouls, three Ghasts or Wights, or two Mummies. See the Monster Manual for these stat blocks.
* - (one 150+ GP black onyx stone for each corpse)
Is it just me, or is this a rather weak spell for being 6th level? I mean you create three ghouls, not even ghasts, and being realistic here you're using them as meatbags for the total 66 HP they can tank, since you're certainly not hitting creatures at that level with a +4, and fireball is better at dealing with crowds. But even then, one fireball from a flameskull and they're gone, polymorph is way better at letting someone tank since if you're a T-Rex, you get 136 Temp HP. So, beside obvious world-building reasons, what's the point of the spell?
well it's a very strange comparison to make between those two spells that aren't really comparable, but a few notes:
the spell is probably still a little bit undertuned, but i feel like you are very much comparing it to the wrong things
Also, polymorph takes an action to cast, while Create Undead has a casting time of one minute. It's not meant to be used in combat.