I believe the motivation was either revenge or delusions of heroism. If the kid believes that abiding by the law is the same thing as being moral then I submit that the kid is confused.
Anyone who doesn't toe your line is demonized.
You just don't get it!