The Affordable Care Act makes some effort to accommodate people who live in states that did not expand Medicaid. For example, people below the Federal poverty level but who live in states that have not expanded Medicaid may qualify for a hardship exemption from the individual mandate.
However, the real answer is that the authors of the law didn't expect states not to expand Medicaid. Originally, the Affordable Care Act made all state Medicaid funding contingent on expanding Medicaid. However, the Supreme Court ruled in National Federation of Independent Business v. Sebelius, 132 S. Ct. 2566 (2012), that this was unconstitutionally coercive, and struck down the portion of the law that would deny states funding. As such, many states chose not to expand Medicaid, even though the federal government would pay for almost allalmost all of this expansion.