Even the ancient Greeks knew the world was round, and it's pretty clear that medieval European peoples were aware of this fact as well. And yet, it is a common trope in a lot of media, when referring to the backwardness of the middle ages, to point to the apparent lack of this knowledge. When did this start, and where did this notion come from?
Umberto eco in his The Book of Legendary Lands has a chapter devoted to this very subject. Although it is true that there were different views, with clergymen coming up with very bizarre ideas, the earth was known to be spherical. One of the reasons why later writers thought the middle agers were flat earthers can also be ascribed, argues Eco, to a wrong reading of medieval maps, which of course make the earth look flat. Yet our modern maps are flat too but we do not associate them with a belief in flat earth. So it was just a big misunderstanding to be blamed on modern era authors.
Edit: I would point specifically to this thread as probably the best answer.
If you're really interested in this subject there's also an entire book on it called Inventing the Flat Earth: Columbus and Modern Historians by Jeffrey Burton Russell. I must confess that I haven't read it, but it is sitting pretty prominently in my To Buy pile.
As I have remember, yet I'm not holding any respectful degree in history or any related science, it is due to some fundamental and very simple circumstances.
It has developed through the introduction of Judaeo-Christian cosmology that have relied on 'traditional' flat Earth concept that was very prevalent in many different cultures and other societal entities around Mesopotamia, east parts of Mediterranean sea, regions where Ancient Egyptian dynasties were existing, and in other related ethnic groups that have predominantly spoke Semitic languages. Actually, from the beginning of Bronze Age up until the fall of Roman Empire, there were numerous diverse cosmologies that have existed in societies that have interacted with each other, from the place where Greco-Bactrian kingdom was formed after leave of Alexander The Great up to the most Western colonies settled by Carthaginians. Yet, if we will take a look more precisely in the 3rd, 4th, 5th centuries when Christianity have evolved into the movement that could not be easily suppressed by raw power, the roots of Judaic cosmology (flat Earth cosmology) were deeply embedded into evolving Christian thought, that was polished by numerous Councils of Christian bishops discussing issues relating from the subjects of valid ethics up to the issues of understanding the proper cosmology. When Christendom was expanding throughout Europe, Judaic cosmology was not extracted from the Christian thought up to the advent of Renaissance (which was, ironically, also influenced by other sectors of Judaic philosophy that Renaissance scholars, esotericists, and other well-educated people have known to a great extent). This whole commentary doesn't give moral evaluation of whether it was 'dumb' or 'practical' or 'intricately delusional', I'm just sharing what I have known so far.
Again, if anything is factually wrong in my comment, correct me, because I absolutely do not pretend for the most valid source of truth. Here is additional source with great amount of references.
http://www.edition-open-access.de/proceedings/7/3/index.html