TL;DR The practise of naming planets after Roman gods was taken from the Ancient Greeks which was most likely taken from the Ancient Babylonians.
The Ancient Greeks first named the planets after their light giving qualities
| Roman Name | Greek Name | Translation |
|---|---|---|
| Saturn | Phainon | "the shiner" |
| Jupiter | Phaethon | "bright" |
| Mars | Pyroeis | "fiery" |
| Venus | Phosphoros | "the light bringer" |
| Mercury | Stilbon | "the gleamer" |
Mars has a distinct red color so it was associated with fire, Venus is the brightest, so it is the "light bringer".
The Greeks also later had the idea to dedicate the planets to the Gods. Phainon to Cronus, Phaethon to Zeus, Pyroeis to Ares, Phosphoros to Aphrodite, and Stilbon to Hermes. The association to their properties remains somewhat, but the translation is not 100% accurate. Hermes is the messenger, and his planet moves fastest across the sky. Ares is the god of war, and the red color was associated with fire and war.
The idea to dedicate the planets to the gods was probably taken from the Babylonians. The Babylonians named Venus after their goddess of love, Ishtar. Mars after their god of war, Nergal. Mercury after their god of wisdom Nabu, and Jupiter after Marduk, their central god. The similarities between Greek and Babylonian naming conventions makes it unlikely that they arose separately. Whether the Greeks took the idea from the Babylonians or they were both inspired by the same source is unclear.
As with most of Greek mythology the Romans appropriated and altered the names, and it goes without saying that the influence of the Roman Empire was vast, so we now use their names. The other planets Uranus, Neptune and the dwarf planet Pluto were named after the invention of the telescope, and their discoverers kept the same naming convention.
Source:
Evans, James (1998) The History and Practice of Ancient Astronomy
hi! you may be interested in these posts
Why did planets get named after Roman Gods and not Egyptian, Greek or Norse? and this addendum for more examples of planets not named after Roman gods Can you tell me about Non-Greek names of planets and their discoveries in India, China etc?
Was it coincidence that Jupiter, the largest planet in the solar system, was named by the ancient Romans/Greeks after the king/father of the gods? Or did they somehow have an idea of its true size? - includes links to several more re the relationship between planets & gods
more examples of planet names What planets were known to non-Western cultures before modern telescopes, and what names did they give them?