I guess for one, future-proofing. The M1 chip is close to 3 years old at this point, and an M2 Pro Mac is likely to receive software updates for longer. The M2 chip also supports more ram, which may matter to people willing to pay more for 24gb of ram.
Second, it's like asking the people who purchased the M2 Pro Mac mini just what they needed one for, and why an M1 Mac mini didn't suffice. I imagine they wanted the extra horsepower, maybe for playing Baldur's Gate 3 on that larger display?
Perhaps the greater question is - why hasn't the iMac been refreshed, even if it's a simple spec bump to go from the M1 to the M2 / M2 Pro chip?