In this verse, Amos charged the wealthy class of the nation of Israel (the Northern Kingdom) with oppression the poor and worshiping pagan gods.
By law, if a poor man put up his outer robe as security for a loan, the garment had to be returned to him by sundown so he could use it for a blanket (read Deuteronomy 24:12-14-13). But the rich were ignoring this law and even using the robes they had taken from the poor as pallets on which they could kneel down to worship in pagan temples.
Judges of Israel were fining the poor by taking their wine, then offering or drinking this wine as an act of worship before their pagan gods. Such flagrant acts of injustice and idolatry would be punished by the Lord.
Amos 2:8 – They [the wealthy class of Israel lay themselves down upon clothes laid to pledge by every altar, and they drink the wine of the condemned [wine taken as fine, NIV] in the house of their god.