A medical is required by law in most countries in order to obtain a working visa for several reasons.
The first is for the safety of the population. SARS, the Bird Flu, the H1N1 Virus, MERS, Ebola and the West Nile Virus have brought the reality of global epidemics home.
The second is because you may be provided with medical insurance, so they simply want to be certain that you are healthy. They do not want you leaving a week after you arrive due to medical problems.
The consequences of failing a medical depend on where you are and why you fail. If your sickness is curable you will probably be allowed to take medication at your own cost, and then retake the medical.
If you have a more serious illness you may not be granted a working visa.