Yes. It violated God's commands.
"32 Thou shalt make no covenant with them, nor with their gods. 33 They shall not dwell in thy land, lest they make thee sin against me: for if thou serve their gods, it will surely be a snare unto thee." (Ex. 23:32-33, KJV)
"12 Take heed to thyself, lest thou make a covenant with the inhabitants of the land whither thou goest, lest it be for a snare in the midst of thee: 13 But ye shall destroy their altars, break their images, and cut down their groves:
14 For thou shalt worship no other god: for the Lord, whose name is Jealous, is a jealous God: 15 Lest thou make a covenant with the inhabitants of the land, and they go a whoring after their gods, and do sacrifice unto their gods, and one call thee, and thou eat of his sacrifice;
16 And thou take of their daughters unto thy sons, and their daughters go a whoring after their gods, and make thy sons go a whoring after their gods." (Ex. 34:12-16, KJV)
Making a treaty in and of itself was not a sin. But, making a treaty with a pagan nation was in essence a toleration of their sin. What happened when Israel allowed sin within the camp? (See Josh. ch. 7 and Achan's sin; see also Phinehas's righteousness in Num. 25.) Inevitably the sins multiplied and the people began taking part in those same sins.
The whore of Babylon in Rev. 17:5 was the reference from Ezek. 23:17.
"2 Son of man, there were two women, the daughters of one mother: 3 and they played the harlot in Egypt; they played the harlot in their youth; there were their breasts pressed, and there was handled the bosom of their virginity. 4 And the names of them were Oholah the elder, and Oholibah her sister: and they became mine, and they bare sons and daughters. And as for their names, Samaria is [a]Oholah, and Jerusalem [b]Oholibah." (Ezek. 23:1-4, ASV)
"16 And as soon as she saw them with her eyes, she doted upon them, and sent messengers unto them into Chaldea. 17 And the Babylonians came to her into the bed of love, and they defiled her with their whoredom, and she was polluted with them, and her mind was alienated from them." (Ezek. 23:16-17, KJV)
Samaria and Jerusalem were called whores and adulterers because they were turning their backs upon their covenant relationship with YHVH - her husband - and making treaties with pagan nations. God called this fornication.
Treaties and agreements with sinful nations / people puts us in danger of their wants and desires, the pagan sinful practices, and moves us away from our heavenly Father. It has the same effect as tolerating sin, for it makes us partners or accessories to the sin. This is the basis in English law of complicity or accomplice liability for walking away from, or not speaking out when you see a crime being committed. By doing so you are in agreement with that crime.
"30 I will do these things unto thee, because thou hast gone a whoring after the heathen, and because thou art polluted with their idols. 31 Thou hast walked in the way of thy sister; therefore will I give her cup into thine hand." (Ezek 23:30-31, KJV)
"36 The Lord said moreover unto me; Son of man, wilt thou judge Aholah and Aholibah? yea, declare unto them their abominations; 37 That they have committed adultery, and blood is in their hands, and with their idols have they committed adultery, and have also caused their sons, whom they bare unto me, to pass for them through the fire, to devour them." (Ezek. 23:36-37, KJV)
YHVH called their associations with the pagan nations adultery. Based upon that, then we need to be very careful about our companions. Tolerating sin in another makes us a partner in that sin.
I discuss the Whore of Babylon in greater detail at my blog ShreddingTheVeil.org here.