Its not crazy at all, but I would recommend trying to earn the degree while in medical school (ie, between 2nd and 3rd year). Taking time off between med school and residency can make it more difficult to match, especially if you're doing something non-clinical.
I had a friend who graduated from UChicago medical school, took 3 years off to do something completely non-clinical (not even related to medicine), and came back to a pathology residency at UChicago.
Is this person the exception to the rule? Would a 3 year hiatus completely screw up the average applicant's chances of matching into a top position?
Is there a such thing as deferring your matched residency for X number of years?
Programs will, on occasion, defer residency placement - generally for 1 year and for a substantial UNEXPECTED reason (ie, you or a family member are seriously ill, you get pregnant, etc.). Deferring because you decided to do something else, especially for more than 1 year, is generally not smiled upon, especially when it would be likely that you would have known about the potential for wanting to defer at the time of interviewing. Residency is different than medical school.
As for your friend, sure there are always exceptions and you'll note that I didn't say it was impossible to get back into the system, its just harder. Pathology may be more inclined to take someone who is a bit "different", outside the box, etc. than more patient oriented fields.
If you are a toeing the line type, you don't take time off after medical school (at least not more than 1 year) and you don't do something non-clinical. But if you are willing to take whatever small chance there might be that a program will frown about the time away from clinical duties and the definite degradation of clinical skills, then go for it. Most books and faculty members I imagine would say the same.
Heck, I'm a bit of a risk taker myself but I think you need to go down any path with all the information available to you - if you decide that doing the degree after medical school and either trying to defer or put off residency matching is worth the risk, then do it. Just don't act suprised if some programs look askance at being removed from medicine for a number of years or laugh at your request to defer residency for 3 years.
Given the above, I see no reason no to do the MPH or other degree during medical school - ie, take a break between 2nd and 3rd years or during residency. Residency programs will often allow this as well; if you choose to do it between medical school and residency, that's fine - you certainly wouldn't be the only one and no one is saying you won't get a fine residency. But in some places the time off is a red flag so you had better make sure your application is tight everywhere else.
Just my four cents..