As pointed out in this Washington Post article, before joining NATO all applicant states are required to resolve their territorial conflicts. Given that Ukraine has a disputed territory (Crimea) since 2014, could Ukraine have even joined NATO as Mr. Putin claims?
I think this question was addressed partly from a slightly different angle at What, if any, reasons prevented Ukraine from joining NATO? too.