This is a symplesiomorphic trait and they are no more closely related to lizards than they are to mammals.
ðɪs ɪz ɐ sɪmplˌiːzɪəmˈoːɹfɪk tɹˈeɪt ænd ðeɪ ɑːɹ nˈoʊmˌoːɹ klˈoʊsli ɹᵻlˈeɪɾᵻd tə lˈɪzɚdz ðɐn ðeɪ ɑːɹ tə mˈæməlz.