I think the point here is to make fun of the Assyrian horsemen who are mentioned earlier in the chapter, and to say that Jerusalem kowtowing to Assyria and Babylon, and Jews worshipping Assyrian and Babylonian gods, is like Jerusalem/Israel sleeping with animals.
And yes, some Middle Eastern cults included “phallic” elements, so Ezekiel might be mocking Middle Eastern statues of pagan gods.
I’ll look and see what the various interpreters say, but that’s probably it. Israel is God’s Bride, “the wife of his youth,” so idolatry = “playing the harlot” or sleeping around with others.
Checking Cornelius a Lapide –
He notes Samaria’s symbolic name Ohola means “his/her tent,” whereas “Oholibah” means “my tent (tabernacle) is in her.”
He notes St. Jerome said that donkey-sized genitalia were kind of proverbial in the ancient world’s slang, and that basically the Bible writer is saying that the Assyrians and Babylonians were lustful.
And various commentators do say that the horse/donkey lustfulness thing is really about the way the Babylonians and Assyrians lusted to worship pagan gods and to get the Jews to participate. Also, the moral interpretation for us today is that if you don’t listen to God’s word even in your heart and you don’t do virtuous things, you will tend to act like an animal instead of a human.