Nato is a defensive organization. If any member is attacked, every other member has to come to their aid. You can't join if you're currently being attacked. That's a pretty fundamental assumption. Nato exists to prevent future wars by acting as a bloc, not to force their members to join existing wars.
To join nato, ukraine needs to win the war and recover all their territory, release their claims on any russian occupied territories, or get enough of nato's membership on their side to be agree to be forced into the war. None of these are possible anytime soon.