The famous Mishnah (Sanhedrin 90a) about who has no place in the World to Come quotes R. Akiva as saying: Also one who reads foreign books [has no place in the World to Come]. The Gemara (100b) explains that "foreign books" refers to books of the heretics. Rav Yosef adds that one is also not allowed to read from the book Ben Sira. After a long discussion of verses in Ben Sira -- that makes it quite clear that the Sages were very familiar with the book -- Rav Yosef concludes that one may teach from the good parts of the work (milei ma'alyasa de-is beih darshinan lehu).
R. Shnayer Leiman, in his The Canonization of Hebrew Scripture pp. 86-92, collected and analyzed all of the passages in rabbinic literature that discuss foreign books and in pp. 92-102 did the same to the passages that discuss Ben Sira. As he points out, Koheles Rabbah 12:12 explicitly permits reading Ben Sira on an occasional or non-intensive basis.
Do foreign books have the same status as Ben Sira? The Rif, and following him the Rosh, writes that one may not read from foreign books or Ben Sira, even the good passages. Thus, according to the Rif and the Rosh foreign books and Ben Sira seem to have the same status. However, the Pilpula Harifta (n. 7) points out that their position in general is difficult because it contradicts the explicit permission of the Gemara.
Historically, and this is an issue where the aharonim and historians agree, the reason for prohibiting reading foreign books and Ben Sira was that there were sectarians who were adding to the books of the Bible. This was a strong measure to guard the sanctity of the Biblical books. If that is the case, it makes sense that foreign books and Ben Sira have the same status. It also makes sense that later generations in the Talmudic era, after the danger to the Bible had passed, were more lenient on this issue.
The following are reasons to allow the study of foreign books:
1. The Meiri (Sanhedrin 90a) permits the study of heresy for the sake of le-havin u-le-horos -- to understand and to teach (or rule). R. Aharon Lichtenstein ("Torah and General Culture: Confluence and Conflict" in R. Jacob Schacter ed., Judaism's Encounter with Other Cultures: Rejection of Integration, p. 281ff.) attempts to extend this permission beyond what one might initially expect. Drs. David Berger and Lawrence Kaplan ("On Freedom of Inquiry in the Rambam--and Today" In The Torah U-Madda Journal, vol. 2 pp. 46-47) do likewise:
The assumption is that one understands the principles of the Torah and then uses these principles to judge what is acceptable or unacceptable in, say, a particular book or system of philosophy. The possibility that grappling with a particular book or system of philosophy may lead to a revised and deeper understanding of Torah principles to does enter into the picture [for the authors' disputant]. But precisely that possibility was a vital reality for the Rambam, and, we would argue, is the way we should understand the concept of lehavin u-lehorot today.2. The Rashbatz (Magen Avos 2:19) famously explained that his reason for personally studying philosophy and Christianity was in order to be able to respond to the critics of Judaism.
3. A more careful reading of the Rashbatz yields a very different reason. For this, I am indebted to R. Eliyahu Rahamim Zeini whose footnotes to his 2000 edition of Magen Avos proved illuminating (and very entertaining). R. Zeini deduces from a careful reading of the Rashbatz's words that we only entirely prohibit books that contain nothing of value. Books that have both good and bad are permissible to be read and, as the Rashba (Responsa 1:413) writes, reject the bad and accept the good (note that this very responsum is usually used to prove the exact opposite).
This can be deduced from the Gemara's words about Ben Sira. "Milei ma'alyasa de-is beih darshinan lehu." If foreign books have the same status as Ben Sira, then one may study foreign books and teach the good passages. I found an important posek who said this explicitly. In this post, I discussed the controversy over R. Yosef Zechariah Stern's citation from Moses Mendelssohn in a letter that was published in Sedei Hemed. In R. Stern's (among the leading Lithuanian rabbanim of his time) letter of defense that was published in the Pe'as Ha-Sadeh addenda to Sedei Hemed, he explicitly states that it is permissible to teach the good passages, applying the above Gemara regarding Ben Sira to foreign books.