check the power and ground wires going to the amp
check the entire length of both for faults...the power line could be shorting out...though it should blow the inline fuse if it is
the reason why your amp is getting power when the car is off is because it is wired independently of the car wiring, besides the head unit trigger
you could check the trigger wire (the one connecting your head unit to your amp...not the rca cables)...it could have shorted out
also check the wires going to the sub...if they crossed or shorted somewhere, then that could have caused a problem with your amp
you're basically going to have to check all the wires going to the amp until you find which one is shorting out
that would be my best guess anyways