This article brings several reasons why gentiles are forbidden from observing Shabbos:
1. The Rambam in codifiying this law (Melachim uMilchamot 10:9) explains that the issue is in gentiles innovating their own laws:
Similarly, a gentile who rests, even on a weekday, observing that day
as a Sabbath, is obligated to die. Needless to say, he is obligated
for that punishment if he creates a festival for himself. The general principle governing these matters is: They are not to be allowed to originate a new religion or create mitzvot for themselves based on their own decisions. They may either become righteous converts and accept all the mitzvot or retain their statutes without adding or detracting from them.
2. The Maharsha (Sanhedrin 58b) compares Shabbos to the bride of the Jewish people, and compares gentiles observing it to adultery:
The Maharsha explains that the Sabbath is, metaphorically, a bride.
Indeed, the Talmud refers to the Sabbath as a bride and the Shabbos is
greeted in the same way that a bride is greeted. This imagery was
immortalized by Rabbi Shlomo Alkabetz (a 16th century poet and
Kabbalist from Tzfas) in his classical liturgical song, Lecha Dodi,
which is sung just before the reception of the Holy Shabbos. Rabbi
Avraham Sperling writes, based on this allegorical comparison, that
“Shabbos” is the female companion to the Israelite nation. The Jewish
Nation is “married” to Shabbos. Therefore, when a non-Jew follows the
rules of Shabbos, it is as if he is committing “adultery” with the
married bride “Shabbos”, and so he is liable for the death penalty.
3. He suggest (based on Rashi's explanation) that the resting of Shabbos is an exclusive gift to the Jews:
When Adam sinned by
eating the Forbidden Fruit, he was punished by all future males having
to work, “with the sweat of his brow.” This implies that HaShem
expects man to work continuously without rest. However, two thousand
four hundred and forty-eight years later, HaShem granted the Jews a
special present, namely, the Holy Sabbath, with which they can
rest, in contrast to the remainder of society. Therefore, world
society is not allowed to rest because of the curse of Adam, while the
Jews are allowed to rest because the Torah specifically calls for a
Mitzvah of Shabbos, which was a unique gift granted to the Jewish
Nation . . Rabbi Meir ben Todros HaLevi Abulafia (1170-1244) explains that the gift of Shabbos was given specifically to the Jews, and therefore if a Noahide keeps Shabbos, he is actually stealing from the Jews and is therefore liable for the prohibition of stealing (which is one of the Seven Noachide Laws).