When the Jews believed in multiple gods, they had no problem with other gods being worshipped by those in other religions.
But when some of the Jews branched off of polytheism to create the one-god dogma ... they wrote into their book "thou shalt have no other gods before me" which they hoped would stop the worship of multiple gods in all the other religions worshipped up to that time.
But those Jews were not cunning enough to think of writing "thou shalt have no other gods AFTER me."
Had they done written that into their book, my guess is, there would be no Catholics, Muslims or Protestants.
Have no other gods comes from the beginning in GENESIS. The book of Genesis was not written by the Jews.
Theory on the authorship of the book of Genesis: