A lot of it depends on which letters are spare at the time a new style of service comes along, all sorts of letters have been used over the years, there are really only a few left !
Business class was initially C because it was known as "club class" by its pioneers (and still is by a few airlines, like BA). Other airlines used different marketing names for it and didn't want it known as C (which has nevertheless stuck in internal industry descriptions). Hence J was available and used.
Premium class (ie enhanced First class with sleeper seats) got P.
There were arguments over Y class known as "Coach" in the US and "Economy" in the rest of the world, but as a compromise the last letter of Economy got chosen !
Some retired codes for nostalgia buffs:
K - a reduced service "Thrift class" discount fare with no meal service at the back of the plane in the US (particularly to Hawaii).
A - First class on propeller main line aircraft
T - Coach class on propeller main line aircraft. A and T were actually provided in different single-class aircraft on the same route.
And plenty of retired marketing names too. Pan Am's new C-class was "Clipper Class" following a long standing aircraft naming convention of theirs.