If you want to format a HDD, it should be done with the help of an operating system. OS will handle that operation from start to finish. If you want to format the drive that contains OS, then the OS will have to get deleted. So OS cannot delete itself when it is running.
I hope you got it. Now, your only option is first install OS to your ssd and then format your HDD to remove your previous OS.