Poor medical knowledge. Medieval doctors did not understand disease, and had limited ability to prevent or cure it. So, when the plague came, doctors were powerless to stop it.
Medieval European medicine was very different from our modern concept of medicine. There was no knowledge of germs, and only relatively basic tools to diagnose and treat illness. Much of medicine was, at best, based on ancient Roman and Greek ideas of the 'humours'. The ideal was to balance specific fluids known as 'black bile', 'yellow bile', blood and phlegm (the fluids made by your ear, nose and throat). To be in a bad or good humour was evidence of how healthy you were! Other doctors would release "evil spirits" by trepanning (drilling a hole in your head to release them). In this context it is not surprising that the causes listed below emerged.
The following are answered here: