Protestors charged with non-violent offences should be able to explain their motives in court as part of their legal defence, new research says.