Then why didn't they make the improvements before implementing the plan?
No one knew what improvements were needed until the plan was implemented. By then, republicans were fighting to repeal the plan and and blocking democrats attempts to fix it.
Obamacare was not really a failure. It just did not delivery everything promised. It eliminated prexisting conditions so insurance companies had to provide insurance regardless of serious illnesses. It eliminated junk insurance that allow insurance companies to sell plans that paid for low cost common medical care but failed to provide healthcare for really serious problems. It eliminated long waiting periods, up to two years of employment in some cases, and many other rather deceptive practices in the insurance industry. It required insurance companies to provide standardize benefits, making insurance easy to understand and compare. It added a lot of preventive care and provided the largest increase ever in mental health and substance abuse coverage, which was long overdue. And lastly, it increased the number insured.
It's primary failure was high cost to the insured. Insurance companies were promised subsides to keep prices low and a mandatory requirement for insurance designed increase number of customers. Obama was not able to increase subsidies significantly without congress support and republicans blocked any attempt to do so. Many exemptions were granted to the mandatory requirement and finally republicans repealed it. The result was many insurance companies exited the market in areas of the country where competition was badly needed. Needless to say premiums went up making the insurance even less affordable.
If congress had increased subsidies and maintained a mandate that everyone have insurance, rates would have been much lower and the cost to government far less than Medicare for All.
It's ironic that republican work to destroy Obamacare, a healthcare system far less socialist that most healthcare plans in the world, has created a large demand for Medicare for All, a plan far more socialist and a far bigger hit on government revenue.