A bad diode board can cause similar problem. If either the big diodes or the little diodes fail to produce the expected output, there will be a different voltage across the lamp. It will light, warning of the problem. Actually any problem that causes the alternator output, as rectified by the small diodes, to be different than the voltage after the ignition switch, can light the idiot light. If the connection opens completely, the light will be bright.
Bad grounds can wreak havoc with the charging system as well.
The bad connections mentioned above are often the cause of a charge lamp that glows dimly all the time even though the bike runs normally. Often the bad connection in question is the ignition switch contacts. These may usually be cleaned with some lubricating contact cleaner. The connections at this stage of the problem are good enough that the battery still charges, but at a reduced efficiency. There is enough voltage drop across the wires, connections, and switch contacts that the voltage drop lights the lamp.