When you create new midi tracks, the track colors should alternate with the colors set in the preferences. If you create 20 new midi tracks, first has color 1, second color 2, until track 10, and track 11 starts with color 1 again. When you move a track up or down, it keeps its color. The same for audio tracks, just with their own colors.
However, when you duplicate a track, all duplicates will have the same color as the original. So, I guess your tracks with the same color have been created by duplicating.
There was an option to select which color from the preferences is used for a particular track, but this option was removed when track colors where introduced, even when the colors from the preferences are still used, if the track has no track color assigned.