The OP does have a point about the processors in Mac desktops. It just needs to be framed a bit more precisely. With AS, Apple has done a brilliant job optimizing performance vs. power for its Mac laptops. However the optimum performance vs. power point for a desktop is different from a laptop, for three reasons:
1) Desktops aren't constrained by the need to run on batteries.
2) Desktops are bigger and heavier, and thus are not as thermally constrained. This means not only that they can enable more power-hungry processors to run without significant throttling, but also that that they can do it quietly.
3) There's more expectation of high performance with high-end desktops than high-end laptops.
For all these reasons, the question becomes: Why did Apple restrict its desktops to the same max clock speeds for both the CPU and GPU as it did for its laptops, i.e., why are the clock speeds of Apple's desktop CPU's optimized for laptops instead of desktops?
Here are some possibilities.
1) Engineering reason: While the M series processors can operate at higher clock speeds, the power requirements increase too rapidly, giving too little return in exchange for the added power consumption.
2) Engineering + business reason: The M-series processors can't operate reliably at higher clocks speeds. Apple could have designed separate desktop-optimized processors that did run at higher clock speeds, but it was cost-prohibitive to do so, particularly since desktop sales are much smaller than laptop sales. I suspect this is what actually happened with M1-M3, so in that sense Apple really doesn't have a separate desktop processor design--their desktop processors are instead laptop processors expanded with more cores, display engines, memory controllers, etc.
3) Business reason: Apple didn't want the desktops to outshine the laptops, since the laptops are the main sellers.
These all are pure speculation on my part, but I don't think it's #3. Indeed, we may finally see higher clocks for desktops than laptops with M4.