Different mythologies being consolidated, mainly.
Originally—by which I mean as far back as we have evidence to speculate—Poseidon seems to have been married to the earth-deity Dā. The oldest attested form of his name is Maecenean po-te-da-on, presumably from potei Dāōn, "husband of Dā"; this would make him the son-in-law of Demeter (Dā-mātēr, "Dā's mother"). Dā then seems to correspond to Gē/Gaia, from earlier Gdā (attested in Phrygian).
Later, the dominant mythology changed; this may have been part of the Indo-European invasion, or may have been later. (Gdā may have been a pre-Indo-European earth goddess.) Now Poseidon's wife was a personification of salt water or of the ocean itself (*) rather than anything to do with earth. This is where we get the stories of Poseidon and Amphitritë, or Neptune and Salacia; Hesiod's Theogony and Pseudo-Apollodorus's Bibliotheca tell this version.
(*) Amphitrite was definitely a personification of the sea in some authors, but it's unclear if this was her original essence, or influence from the Roman Salacia.
Even later, the Greeks and Romans incorporated some parts of the Phoenician mythology into their own. For the Phoenicians, to the best of my understanding, Adon was the mortal lover of the goddess Ashtarte; when he died, the goddess of death fell in love with him too, and wouldn't let Ashtarte take him back. So Adon became the god of springtime, spending the winter in the underworld, and the summer in the heavens with Ashtarte.
When the Greeks and Romans adapted this myth, Ashtarte became Aphrodite/Venus, the goddess of death became Persephone/Proserpina, and Adon became Adonis. That's why there are two apparently incompatible stories about the seasons: the Persephone story came from the Greeks, and the Adonis story came from the Phoenicians. The sorts of contradictions are nothing new, and the ancients were well used to them: see Dionysus vs Zagreus for another example.
When Nonnus wrote his Dionysiaca in the fifth century CE, he was drawing on the Phoenician lore instead of the Greek lore. Beroë was the daughter of Ashtarte and Adon, representing the city of Beirut; her marriage to Poseidon symbolized how Beirut both controlled and depended on the ocean.
So Poseidon had multiple wives because "Poseidon" wasn't a single person, but a syncretization of several different mythological traditions that were never really meant to go together. You'll notice that no individual source mentions Poseidon having two wives: Hesiod, Nonnus, and Pseudo-Apollodorus all make him monogamous. They just differ in what tradition they're drawing from.