The lesson is not “never partake of meat sold to idols”. Paul’s lesson is “It is better to refrain from certain liberties than to engage in behavior that you KNOW will cause people to reject Christ.”
You omitted verse 27 to make a “point” that distorts Paul’s meaning. Paul’s concern is not with the meat nor the false gods but with doing everything he can to win unbelievers to Christ.
Is your primary concern with halal meat that eating it will cause Muslims dining at your Thanksgiving table to reject Christ?
The point is if you have a choice between clean meat and meat dedicated to Satan then it would be better to choose clean meat.