A lot of different sites that I have looked through have said a couple of different things, one of the websites I looked at said that the origins of the Red Carpet date back to Greek mythology where Agamemnon, after returning from Troy, walks a carpet that is laid out by his wife in order to welcome him back home from his long journey. According to greek myths, red carpets were used to honor the gods and so when Agamemnon had walked on the carpet, he was punished because he knew that they were strictly for the gods and goddesses. Looking deeper into this, myself, and comparing it to today's Red Carpet in Hollywood, the celebrities are "the gods" and the paparazzi is "Agamemnon" because crossing the limits/boundaries of the celebs beyond the red carpet will receive a lawsuit or even get dragged out and beaten up by the celeb's bodyguards, their "punishment."
Another site I saw said that it can be related to the Renaissance period as portraits done by artists always showed the person in the photo standing on some sort of carpet. Delving more into this topic and thought of the Kings and Queens of the Renaissance Era. Back then, the color "red" and "gold" were associated with people of status. And so, in paintings you see a lot of pictures of the royals of that era wearing red. Later on, we start seeing the red carpet placed in front of thrones, or even thrones are of the color red (such as the portrait below with Queen Victoria and her family).
Another notion was that around the late 1700s, when trains with steam engines were first invented, it was very expensive and so only people of upper class were able to journey on trains. Before everyone boarded the train, red carpets would be laid out in front of the entrances of the carts.
Nowadays the "Kings and Queens" of Hollywood have taken over the red carpet: "celebrarchy."