As others have said, these are two different issues. The fact that the government only has only a limited right to restrict false religious activity (ie man has a limited right to be free from civil coercion in religious matters) does not mean people have a moral right to commits acts of idolatry. The Catechism section on the 1st Commandment deals with both issues:
http://www.vatican.va/archive/ccc_css/archive/catechism/p3s2c1a1.htm
Some excerpts:
2105 The duty of offering God genuine worship concerns man both individually and socially…
2106 "Nobody may be forced to act against his convictions, nor is anyone to be restrained from acting in accordance with his conscience in religious matters in private or in public, alone or in association with others, within due limits."34 This right is based on the very nature of the human person, whose dignity enables him freely to assent to the divine truth which transcends the temporal order. For this reason it "continues to exist even in those who do not live up to their obligation of seeking the truth and adhering to it."35
2108 The right to religious liberty is neither a moral license to adhere to error, nor a supposed right to error,37 but rather a natural right of the human person to civil liberty, i.e., immunity, within just limits, from external constraint in religious matters by political authorities. This natural right ought to be acknowledged in the juridical order of society in such a way that it constitutes a civil right.38
2109 The right to religious liberty can of itself be neither unlimited nor limited only by a “public order” conceived in a positivist or naturalist manner.39 The “due limits” which are inherent in it must be determined for each social situation by political prudence, according to the requirements of the common good, and ratified by the civil authority in accordance with "legal principles which are in conformity with the objective moral order."40
2112 The first commandment condemns polytheism. It requires man neither to believe in, nor to venerate, other divinities than the one true God. Scripture constantly recalls this rejection of “idols, [of] silver and gold, the work of men’s hands. They have mouths, but do not speak; eyes, but do not see.” These empty idols make their worshippers empty: "Those who make them are like them; so are all who trust in them."42 God, however, is the "living God"43 who gives life and intervenes in history.
2113 Idolatry not only refers to false pagan worship. It remains a constant temptation to faith. Idolatry consists in divinizing what is not God. Man commits idolatry whenever he honors and reveres a creature in place of God, whether this be gods or demons (for example, satanism), power, pleasure, race, ancestors, the state, money, etc. Jesus says, "You cannot serve God and mammon."44 Many martyrs died for not adoring "the Beast"45 refusing even to simulate such worship. Idolatry rejects the unique Lordship of God; it is therefore incompatible with communion with God.46