'No debió haberlo hecho' and 'no debió hacerlo' mean the same. 1 is correct: 'he shouldn't have done it'.
'He did not have to do it' would be 'no debía hacerlo'.
By the way, both sentences could be said about a female or about a male: it's third person singular; apart from that, we don't know anything about the subject.