Knowing an assassin’s motive is always important for many reasons but the top two being prevention & punishment.
Prevention is obvious but as far as punishment, someone who commits an assassination due purely to because they are mentally ill may receive a sentence of institutionalized & may at some point even be qualified for parole.
Someone who commits an assassination purely for political reasons would be more likely to receive life without parole or the death penalty.
So yes, motive does matter. A lawyer should know that.