So I’ve been researching this for a couple months now, I’ve heard a couple people say it was Muslims that burned it down, others say it was the Christians, but all the actual sources I’ve read say that it wasn’t burned down so much as a king (whose name I don’t recall) feared intellectuals, and purged them or drove them into hiding, leaving the library unattended and inaccessible to the people. So I guess what I’m asking is who was the real culprit and what were their reasons.
Questions about library of Alexandria appear quite frequently, so you might check the responses in the FAQ. Most notably, this reply [author's account has been deleted] and this thread [also, the person whose responses relate to your question also has their account deleted, so I can't give credit where due] concerning the timeline and methods of the Library operation and this response by /u/XenophonTheAthenian focusing on the actual importance of the Library in ancient world.
Addressing your question directly, it is quite strange that research led you to two myths and a rumor that is nowhere to be found in any historical sources. The notion that Library of Alexandria was burned by Muslims most likely comes from conflation of the history of the Library with the sack of Baghdad in 1258, as Islam emerged almost two centuries after the last information about Library of Alexandria or from the likely, but undocumented notion that the remaining books were taken by Arabs during their conquest of the area in 7th century. Another source of confusion might be the legend of caliph Umar ibn al-Chattab who destroyed the books stating that they either contain the same truths as Quran or information contrary to Quran, so either way they had to be destroyed as useless or blasphemous, although the story appeared only in 13th century, in the writings of Abul Faraj (Gregorios Bar-Hebraeus) and is so far considered a myth. Likewise, alleged burning it by Christians most likely comes from an assumption that the Library was still housed in Serapeum when it was damaged and subsequently demolished during the riots of 391, even though there is no historical evidence to corroborate it.
The notion that Library of Alexandria was closed by some ruler may stem from the expulsion of Aristarchus of Samothrace, who held the office of the chief librarian, who was deprived of his position and exiled from the city along with other coworkers and most foreign scholars in 145 BC, after Aristarchus himself got caught in the power struggle between Ptolemy VII and Ptolemy VIII, in which he supported the former. When Ptolemy VIII was his precedesor (and nephew) and replaced him on the throne, he proceeded to purge the city of all known supporters of his opponent, causing them to leave Alexandria or Egypt altogether. It may have also been conflated with the the events of 529, when Emperor Justinian ceased state funding of the Neoplatonic Academy what caused many of the scholars to move to other schools within the Empire, although there is no link between this edict and either closing of the Academy (it existed for at least few decades more, according to some reseachers) or the Library of Alexandria. It is theorised that this event led to the formation of other schools founded by former Alexandrian scholars that undermined the position of Alexandrian Library.
The only documented proofs of the actual destruction of the stored texts relate to the Romans. First, Caesar's intervention in the power struggle between Cleopatra and Ptolemy XIII and subsequent military actions undertaken in Alexandria resulted in fire that damaged Royal Palace in the Brouheion district, but even then, the accounts are contradictory. Seneca mentions 40.000 lost manuscripts in his 'De tranquilitate animi' while Orosius gives a number ten times higher and Cassius Dio, who mentions the fire at the docks does not write anything about the damage to the palace or library (although all three were not contemporary writers). Brouheion has been almost completely destroyed in 273, during the war between Emperor Aurelian and Septimia Zenobia, regent of Palmyra.
If anything, the fall of Library of Alexandria was most likely not caused by a insidious political actions taken by rulers but by the exactly opposite process. In addition to the proliferation of schools caused indirectly by the actions of Ptolemy VIII mentioned above, in the times of Roman control over the Egypt, many new libraries were founded both in Alexandria (Caesareum and Claudianum were two renowned Alexandrian temples holding large amount of texts since 1st century AD). Thus, what was basically the centre of learning in this part of the world became only one of many scholarly facilities and thus received less attention (and thus less funding, acquisitions, famous teachers etc.) than before. By the 3rd and 4th century, when the destruction of buildings that held the original library took place, Library of Alexandria was generally one of a provincial temples housing a school.