I'd bet the reason was to cater to color television. Yet the splashes of color, light and shadow—even across the actors—had a chiaroscuro effect, and just made the shots more pleasing to look at than flat, diffuse lighting.
A few years later, Space: 1999 did something similar with the Moonbase Alpha interiors. The walls already had the geometry to do interesting things with light. But the walls themselves also lit up! This made for futuristic, diffuse lighting. Although the usual tools of key, fill and backlight were also used. After the pilot episode, the normally white-only wall lights started to take on colors. However, the usage never suggested something built-in to Alpha for purposes of crew psychology and well-being. The colors were used to accent the mood of scenes.
^^this
Color television was new, RCA was selling color TVs, and Star Trek definitely helped sales:
https://www.giantfreakinrobot.com/ent/star-trek-the-original-series-color.html
Nobody understood the show, but nobody was going to throw away nearly $500,000 in unusable sets, and with the coincidental release of color broadcast signals with 1965 being the first year that color would be prevalent (and exponentially more by 1966), it was yet another big reason to push forward and take advantage of the new technology in this futuristic show. Marketing 101, Psychology 101, 101 101, you name it.
Any half-baked cynicism or any other notions of sales pitching aside, TOS was there when color tv was new and the use of color palette to juggle so many colors without feeling bombastic is an impressive artistic accomplishment no matter what. Especially as the costumes used red/gold/blue (primary pigment colors), or red/green/blue (primary lighting colors). So thought was put behind TOS. Which took people, time, and money, contrary to modern belief because the show is said to look cheap. (put TOS up anything else in the mid-1960s and it was anything but cheap, but before I digress...)
(Note: The season 2 cast photo from the aforementioned site, in lesser hands, would be as gaudy and florid as anything could get. But that photo, as balanced, is a genuinely fantastic presentation of balancing it all.)
Now fast forward a decade, when tv shows stopped irradiating the CRT with every hue and saturation possible because the honeymoon ended. Even shows like
Wonder Woman where episodes featuring aliens or future-era humans had sets bathed in different colors to differentiate their locale for 20th century Earth and, by 1977, color TV was anything but new, so Trek had an unintentionally lasting effect where other shows, like Batman, had not.
In-universe, the use of color to sooth or excite is too easy a given and I'm hardly a major in psychology. Quite the contrary... But quarters could be backlit in whatever hue for whatever reason, a trend that disappeared later on. And trends
can come and go and return and go again.