2 reasons. He wanted to make life just like people, and the archeologist accidentally gave him permission when he said he’d do anything and everything for the mission. David probably didn’t think it would kill him.
I thought it was related to the android’s comment of wishing to kill his “parents”, but that didn’t seem to fit since Weyland was his maker.