Why did NATO not extend to include Ukraine along with the Baltic States back in 2004?
Note: This is somewhat related to this question
According to CNBC, one of the goals of Russia is to prevent Ukraine from joining NATO.
I am not sure if this is related to not having a direct border with NATO or because Ukraine is a former Soviet state. This map shows NATO's expansion since 1997 and after the Baltic States have joined NATO, Russia has a direct border with NATO.
I assume the fact that Baltic States are part of NATO makes a difference, despite being the former Soviet States. This makes me wonder what prevented Ukraine from joining NATO earlier and possibly benefiting from the membership nowadays?
I am specifically interested in the reasons why not joining in the early 2000s when Russia was more affected by the collapse of the Soviet Union than it is in the 2020s.