Two possible ways to look at it imo:
The church at Pergamum was generally weak, so they should basically be told just plain stay away from pagan temples.
Or,
"So you also have some who hold to the teaching of the Nicolaitans likewise."
The teaching of the Nicolaitans was creating a stumbling block for some in Pergamum, just like the counsel of Balaam had created a stumbling block for Israel.
Revelation 2:12-16 And to the angel of the church in Pergamos write; These things saith he which hath the sharp sword with two edges;[13] I know thy works, and where thou dwellest, even
where Satan's seat is: and thou holdest fast My name and hast not denied My faith, even in those days wherein Antipas was My faithful martyr, who was slain among you where Satan dwelleth.[14] But I have a few things against thee, because thou hast there them that hold the doctrine of Balaam, who taught Balac to cast a stumblingblock before the children of Israel,
to eat things sacrificed unto idols and to commit
fornication.[15] So hast thou also them that hold the doctrine of the Nicolaitans, which thing I hate.[16]
Repent; or else I will come unto thee quickly, and will fight against them with the sword of My mouth.
Revelation 2:20-24 Notwithstanding I have a few things against thee, because
thou sufferest that woman Jezebel which calleth herself a prophetess, to teach and to seduce My servants to commit
fornication, and
to eat things sacrificed unto idols.[21]
And I gave her space to repent of her fornication, and she repented not.[22] Behold, I will cast her into a bed and them that
commit adultery with her into great tribulation, except they repent of their deeds.[23] And I will kill her children with Death, and all the churches shall know that I am He which searcheth the reins and hearts, and I will give unto every one of you according to your works.[24] But unto you I say--and unto the rest in Thyatira, as many as have not this doctrine--and which have not known the depths of Satan, as they speak; I will put upon you none other burden.
Where was Jezebel given space to repent? unless she was in Pergamos, too. And Antipas must have passed the devil's test in Smyrna... there's no Repent being asked of them. The only Repentance for Ephesus required her return to the strength of her first love, after she'd rooted out the false-sent-ones and therefore, stopped trusting her brethren.
But here's the thing. Eating things sacrificed to idols, in the Revelation... fornication is always part of it. And fornication means to commit adultery. And spiritual adultery was the cause of the captivities of the House of Israel and the House of Judah.
So the Revelation belongs to the Gospel of Kingdom of Heaven for the Lost Sheep of the House of Israel.
It isn't part of the gospel to the gentiles who can eat in the temple of the idol.