It does use the same engine as StarCraft II. It originally started as Blizzard All-Stars and was supposed to be a custom map for the SC2 arcade, but the team ran into technical roadblocks that pushed them into making HotS a separate game.
The "technical roadblocks" were no easy way to monetize it as a map.