when the power to the head unit is cut, either by you switching the head unit off or the car, there is a voltage spike produced that is making its way through your RCA outs to the sub amp.
Ordinarily, what SHOULD happen is that when the power to the head unit disappears, the sub amp remote turn on voltage should be the first to drop to zero, causing the sub amp to switch itself off before that little spike makes its way to the inputs.
Most decent car audio amps also have a subsonic filter built in that removes any voltages that dont oscillate above about 10Hz. This covers pretty much any DC spike that may present itself at the inputs for any reason.
Diagnosis can be made from there.