He was assigned. They obviously needed a lawyer capable of representing a defendant in a multiple murder case. Given that the attorney got Batman a life sentence rather than the death penalty, Dear could have done far worse.
Defense counsel is a public defender.