Man gets life in prison in child's beating death