Why must my device be compatible with a certain ROM before I flash it to my device?
No long explanation needed, the reason is quite simple: Different devices come with different hardware components, such as the camera or sound "chips". Those require special drivers, which are in most cases proprietary and not part of AOSP (which is the "Android base code").

This means, each ROM must include device specific code, and thus is specific to the device it is created for.