Getting a frame that fits is in my opinion the very most important thing. All the other things on a bike can be swapped and changed to fit your changing needs and your changing budget over time. But if the frame itself is a poor fit you will likely get discouraged and be uncomfortable. You will want to ride less, not more.
Some people start out on a heavy hybrid or a cheap mountain bike and ride on the roads when a road bike might have been a smarter first choice. But if that bike fits them well and they are comfortable on that bike, they ride it more and more and begin to really love biking- that's when they later figure out what they really need and maybe sell the old bike and get a new better suited one. (Some of these people have happily ridden centuries on their heavy hybrids. )
Another person might start out with the same hybrid but that fits them badly and makes their back hurt, etc. That person might just give up on biking after a couple of months, disgusted with the whole unpleasant ordeal.
Getting a bike that fits comfortably makes bike riding a joy. When riding is a joy, all other obstacles seem to become less daunting.