The in-universe reason given during the initial planning of the show was that time itself varies depending on both speed and gravity. Because of this, different areas of the universe may have different flows of time, and the old method of telling time only worked well when Earth was the constant.
"They marked off sections on a pictorial depiction of the known
universe and extrapolated how much earth time would elapse when
traveling between given points, taking into account that the
Enterprise's warp engines would be violating Einstein's theory that
nothing could exceed the speed of light. They concluded that the 'time
continuum' would therefore vary from place to place, and that earth
time may actually be lost in travel. 'So the stardate on Earth would
be one thing, but the stardate on Alpha Centauri would be different,'
- Gene Roddenberry: The Myth and the Man Behind Star Trek
In answering these questions, I came up with the statement that "this
time system adjusts for shifts in relative time which occur due to the
vessel's speed and space warp capability. It has little relationship
to Earth's time as we know it. One hour aboard the U.S.S. Enterprise
at different times may equal as little as three Earth hours. The star
dates specified in the log entry must be computed against the speed of
the vessel, the space warp, and its position within our galaxy, in
order to give a meaningful reading." Therefore star date would be one
thing at one point in the galaxy and something else again at another
point in the galaxy.
- The Making of Star Trek