Honestly IT is a very wide field - it really depends on what you're studying within IT.
With that said, the iMac right now... it's not a bad computer, but it is a very expensive computer and it'll quickly be replaced by a new Apple Silicon / M1(x?) model. It also isn't very upgradeable. If you are a tinkerer you could build a much better computer for less money with much better upgrade paths in the future.
What you want really depends on what you're doing but personally I'd be leaning towards getting a desktop PC and keeping the MacBook for when you need portability.
But again, IT is a wide field. Are you developing iOS apps? Then you need a Mac. Also, a lot of web and mobile developers use Macs though this is gradually shifting over to PCs. On the other hand, I'm developing web apps and I'm finding Windows + HyperV are downright excellent for virtualising the various Linux environments that I need, and WSL2 is genuinely excellent.
Also if you are going into the corporate IT side of things (i.e. Active Directory and so on) you'll definitely be much better served by a PC with Windows.
I used to use an iMac, but I switched to a PC that I built and honestly you couldn't pay me to go back. The iMac has a wonderful screen and macOS is a nice OS but in 2021 so is Windows 10. My PC is genuinely rock solid and the performance is insane. At the same time, I still really, really like my MacBook Pro.