For the Imperius curse defence being invalid because 'they would have had no ability to form the intent necessary to cast unforgivable curses themselves while under the Imperius' argument; that's flimsy as hell and if Grabbit was actually a remotely competent barrister he'd immediately point out that all that 'proves' is that Mr. Malfoy may have violent urges or that he's got bigoted thoughts. Thoughts however are not crimes, actions are crimes and the Imperius curse cast on Mr. Malfoy removed his natural disinclinations to actually follow through with those thoughts, forced him to give in to his baser instincts by removing his inhibitions, stripping him of his conscience and rendering him bereft of the ability to hold himself back from acting out on those violent urges.
Add a few crocodile tears from a 'remorseful' Malfoy and bang presto we don't even need to pay any bribes to get him off because the prosecution just helped us paint him as a victim. Thanks Connie! You over-zealous fool.
It's not illegal to feel as though you'd like to kill or hurt or use someone, it's illegal to do it and when he did it he wasn't in control of his actions and was even being further encouraged to carry those actions out. To use a common metaphor, it's like he had a devil on each shoulder telling him what to do. Clearly from his charitable and philanthropic work since he's been freed from the curse and regained his faculties you can see that he is in fact a person who prefers to listen to their angel's counsel and ignore their devil when given a fair chance to make the decision which to heed for himself.
Sincerely, A bastard that is actually slippery