Yabia Omer Used This Incident As Proof That You May Not Visit Churches – In Reality the Incident Was Referring to a Sufi Muslim Tekke
In Rabbi Ovadia Yosef’s article on visiting churches and mosques in Yabia Omer, Vol. 7, Yoreh Deah, Siman 12, the words of the Magid which I will quote in the continuation of this article are brought as one of the proofs for why Jews are forbidden to visit churches. However, Rabbi Ovadia Yosef made a mistake about the facts. The Magid was not talking about churches. He was talking about a Sufi Muslim house of worship, which is called by the name, Tekke.

The Magid of Rabbi Yosef Karo criticized Rabbi Karo for going after the Idols Because Rabbi Karo Visited a Sufi House of Worship, called a Tekke
This was the incident as described in Magid Meisharim, to Bechukotai, the 28th of Iyar.
We passed by the entrance of the Tekke with some friends and they brought me in there…
And later I arose, and while I was still by the book, he (the Magid) said to me, “be strong and courageous in all that you do, and all that you do, Hashem will make successful and will be successful through you; just don’t stop the link and the attachment between you and your Maker (G-d) and also do not turn to the idols and to not go after the Baal idols like you did yesterday and also it is already 3 days that you have stopped the link and the attachment between you and your Maker; for you have stopped thinking continually (about G-d related topics) and I have raised you up, so that your heart will continually be a vessel for my Torah, you shall not separate from it, even for a moment; and I have also recounted you to be burnt over the sanctification of my name, so that your iniquities will be atoned and you will ascend, as I have informed you. But now you have turned your heart from the words of Torah and you have also turned to the idols and went after the Baal idols, for you have entered yesterday into their house of worship (alt. translation, saints who are nicknamed harlots) and I have already informed you that 7 clouds of glory accompany you and all of them separated from you, when you entered there and they wanted to depart from you entirely, if not for the sons of the academy in heaven that prayed before the Holy One Blessed be He that they would not depart from you; and by means of this they waited for you until you left and went from there and returned to accompany you as at the beginning …
Be careful from now on and continually think about in your heart about my Torah and let the fear of Hashem, be so much attached to you that if it will occur that you see or hear an “Erva” matter, it will make no impression upon you at all and you should never again enter the house of the Baal Idols and you will return to your holiness”, (end of quote).
When the Magid said “You have also turned to the idols and went after the Baal idols, for you have entered yesterday into their house of worship (alt. translation, saints who are nicknamed harlots) ” What Element of the Sufi Muslim Religion Caused the Magid To Make Such a Statement?
In my article When Is It Permitted to Bow to Men and When Is Bowing Forbidden Intermediary Worship , According to Rabbeinu Nissim I offered the explanation, based on the commentary of Rabbeinu Nissim (“The Ran”) that the Magid was pointing to the practice of this sect of Islam to bow to dead people as intermediaries, which Rabbeinu Nissim contends is Avoda Zara (prohibited foreign worship).
However, the fact that the Magid stressed that there was also an element of forbidden Baal worship at the Tekke opens up the possibility of additional explanations.
The Proof that Tekke is A Sufi Muslim Place of Worship
https://en.wikipedia.org/wiki/Khanqah
A khanqah or khaniqah (also transliterated as khankahs , khaneqa, khanegah or khaneqah (Persian: خانقاه)), also known as a ribat (رباط) – among other terms – is a building designed specifically for gatherings of a Sufi brotherhood or tariqa and is a place for spiritual retreat and character reformation. In the past, and to a lesser extent nowadays, they often served as hospices for saliks (Sufi travelers), Murids (initiates) and talibs (Islamic students). Khanqahs are very often found adjoined to dargahs (shrines of Sufi saints), mosques and madrasas (Islamic schools).
In the Arab world, especially North Africa, the khanqah is known as a zāwiyah (Arabic: زاویه, plural zāwiyāt; also transliterated as zawiya, zāwiya or zaouia). In Turkey, Iran and formerly Ottoman areas like Albania and Bosnia, they are locally referred to as tekije (تكيه; also transliterated as tekke, tekyeh, teqe or takiyah). In South Asia, the words khanqah and dargah are used interchangeably for Sufi shrines. In addition, there are lodges in Central and South Asia often referred to as Qalander Khane that serve as rest houses for the unaffiliated malang, dervishes and fakirs.
All khanqahs, regardless of size, feature a large central hall. The daily ritual prayers incumbent on all Muslims, salat, are held in this hall, as are the specifically Sufi forms of dhikr, meditation and celebration of the divine.
Large khanqahs often grew up around the dargah of a tariqa’s founder or of a Sufi saint.