Believe it or not, only about 2/3 of MDs are board certified as per AMA. Furthermore, there are some people quite qualified who can't be board certified, because it doesn't exist. Example.... there's no board for pediatric hematology, but there's nothing stopping a pediatrician or a hematologist for calling themselves that. In fact, ENTs have been fighting with the pediatricians recently over pediatric otolaryngology cases.
The restriction on this practice as the OP described is not legal, but rather professional and social. Its hard to find a job if you are not boarded in the basic speciality board. I was describing instances of subspecialists that don't have boards, there are certainly boards for all the specialities. Also, with the current malpractice crisis sweeping the nation (sans California, Indiana, Wisconsin, etc .. I know), no one wants to risk the loss of their practice, meaning their livlihood, by jumping back and forth and practicing medicine that they are not quite qualified to practice. However, in one sense you are correct, an MD is an MD, so if you are an unboarded "general surgeon" and the hospital lets you do a call in IM one night; that's the only scenario where I see this possibly occurring.