Because mechanical engineering isn't only math? Math is used of course, but that's true about essentially all professions. But yes, if there is some sort of a pure mathematical model/equation that could apply to mechanical engineering, I'm sure the GP would also agree that it should not be patentable.
Neither is software: memory constraints, latency, reliability, cpu speed.
Almost the entire cryptography field relies on physical limitations on execution speed. Anyone working on even remotely real time systems has to account for these same limitations and possibly work around them.
Every student learns about runtime and memory complexity of various algorithms. Something that would be entirely irrelevant in a purely mathematical context. At what speed does an ideal Turing machine run? How much memory does it have?
E.g. can you get rich from developing scientific software? Probably not. Perhaps patents can be of use there.