You're thinking of HDCP, not HDMI. HDMI recorders exist (Elgato built an entire brand off selling them for console game streaming) but they are not allowed to speak HDCP because
gestures vaguely at DMCA 1201.
In the specific case of the iMac:
- USB-C video outputs are all either DisplayPort[0]. HDMI Forum was promoting an HDMI USB-C altmode but it was never implemented. USB-C HDMI adapters are all DisplayPort adapters that additionally tunnel DVI traffic (because HDMI 1.x is actually single-link DVI with a funny connector and extra bits).
- Apple used to support Target Display Mode for video input until the Retina iMac a decade ago. They dropped Target Display Mode because their 5K display panels were using eight lanes of DisplayPort, a configuration that doesn't exist[1] outside of Apple's custom display controllers. Every other 5K display (and even some 4K ones) were instead using multiple cables, with some extra (poorly-supported) metadata to tell the graphics card to treat both halves of the display as one.
Why Apple hasn't brought TDM back now that we have enough bandwidth for 4.5K over standard cables is beyond me.
[0] Or MyDP, aka "the funny Nintendo Switch altmode"
[1] Think of it like a "32-lane PCIe port". It's technically possible but no host or device silicon supports a link that wide.