A lot of that CP/M compatibility comes from the fact that the 8086 had a high degree of backwards compatibility with the 8080/8085 (and thus also the 8008). It wasn't actual binary compatibility, but the instruction set was either a strict superset or close enough (albeit with different encoding) that you could take an 8080 program written in assembly language and run it through an appropriate 8086 assembler to produce a valid 8086 binary. Since the processor made it possible to port software that seamlessly, it made sense for operating systems to also provide a compatible ABI.