Why do some RGB LEDs have six legs?
According to the datasheet, it has six legs because it contains 3 LEDs, with nothing common:



Many RGB LEDs have a common cathode or common anode, so need only 4 leads. For some applications that may not be acceptable. For example, it wouldn't be possible to control two RGB LEDs with common cathodes or anodes in series, or to arrange them for charlieplexing.

Further, a part like this is at least more flexible. It can be made common anode, or common cathode. Or, a pair of the LEDs may be arranged in anti-parallel. It may make more sense in some situations to stock just one part than to stock several different parts to cover different cases.