CP/M viruses could have spread quite successfully
I doubt about that:
A virus cannot infect every kind of file format but only files that contain code:
- Executable files
- Other files that contain any kind of code (e.g. macros in office documents)
- File formats that can be manipulated in a way that an error happens when opening the file which causes the computer to execute some code - for example by forcing a buffer overflow
In the 1970s and 1980s, file types that match criteria (2) and (3) were not used very often (if they existed at all) so a virus could only have spread using executable files.
While home computer users were exchanging executable files (illegally copied games!) very frequently, I doubt that professional users (using CP/M) were exchanging executable files.
EDIT
After having read the comments, I'd like to extend my answer a bit:
Back in the times when computers had no network/modem/internet/... access, viruses could only spread widely in the following scenario:
- Some user starts an infected CP/M program
- The virus infects other CP/M programs on the user's computer
- The user gives some of these CP/M programs to a second user
- The second user gives some infected CP/M programs to a third user
- The third user gives some infected CP/M programs to a fourth user
- And so on ...
I already doubt that this scenario happened as often as the comparable scenario happened with C64 programs. (Note that a CP/M virus would probably not be able to infect non-CP/M programs on computers where CP/M is not the only OS - such as the Amstrad CPC, the Commodore 128 or some MSX machines.)
You also have to see that the actual process of infecting a file is much more unlikely in the case of a CP/M virus:
CP/M computers were not hardware compatible at all. A program or virus could not directly access the hardware nor do anything else not officially supported by the operating system.
Therefore, the only way a CP/M virus could infect another program is when the program is stored on a disk that had to be in the drive while the infected program is running. (Most CP/M versions did not support parts of the program staying in the RAM after the program has finished.)
In contrast, a MS-DOS or C64 virus could do things not officially supported by the operating system. They could stay in RAM after a program has finished (under MS-DOS this is even officially supported). When you insert a disk much later, it can infect the programs on the disk.