As a matter of fact, that was not the case in the Islamic empire - the government had encouraged independent research and learning and funded it quite extensively, which is the biggest reason it was such a scientific boom period. It's quite astonishing how far they've fallen, because at the peak of the European medieval times, the Islamic Empire had been encouraging this sort of scientific research and study like crazy. Perhaps most famous of all are the scientific libraries of Baghdad which once held volumes of literature and research pertaining to medicine, literature, physics, chemistry, and biology; and were made available (mostly) to all.
Invasions and wars in the region, along with the decline & fall of the Islamic Empire brought an end to that golden age of science and knowledge which is really sad because in that short period of time a lot of knowledge was discovered and contributed, lending to the future discoveries by European scientists in Calculus, Chemistry, Medicine, and more.