I apologize if this was already mentioned, this is a very large and informative guide.
There are some rules to the secondary stat increases while leveling mods.
Green mods, the first level secondary stat increase (level 4) is added on to the first secondary stat.
In Blue ones, the first two secondary stat increases (albeit smaller increases) are added to the 2nd secondary stat (first one is ignored).
In Purple mods, the first two increases go to the first secondary stat.
I think there is always "a chance" to get a random increase on an already existing mod as a bonus.