This is a wonderful principle to guide us which Paul extends beyond the subject of food offered to idols. It can be applied to our eating and drinking, and all that we do in life.
We are to examine our own behaviour by our own consciences, but we are also to examine it by the consciences of others. That will cause us to behave differently in different company. Paul paid attention to Jewish scruples when he was in the presence of Jews, and he considered a different set of scruples when he was with Gentiles. Before Jews, he would not avoid doing things which the law forbade, such as the eating blood. He did this even though those requirements were passing away, and further advance might teach them that these were matters of indifference. Paul had Timothy circumcised so as not to offend the Jewish conscience. Before Gentiles he was careful to support himself, so they would not think he was out for money. To the church of God where there are those with greater understanding, different behaviour again is called for. The consciences of others may command us to do the wrong thing, and then we desist – Shadrach, Meshach, and Abednego did not bow before the golden image. But where the consciences of others are not explicitly wrong but are only weak, we submit ourselves to them, even relinquishing our own rights.
Is this to pander to ignorance? No, but it recognises that there are different levels of knowledge among men and women. God in his patience lead us at the pace we are able to go. Ultimately he will bring us all to a perfect knowledge, but now we still see through a glass darkly.