There is no ground to deny someone a visa or deny someone entry based on having used Medicaid. There is a ground inadmissibility if someone is "likely to become a public charge", but the determination of that currently does not consider non-cash benefits like Medicaid (except Medicaid for long-term institutionalized care).
She was denied entry for failure to overcome the presumption of immigrant intent. The presumption of immigrant intent applies to most types of nonimmigrant visas, and it says that the officer must presume the person is an immigrant, and thus ineligible for the nonimmigrant visa, unless they can prove otherwise. This is a generic reason used to deny visas when the officer feels that there is any factor in the applicant's situation they do not like (but there is not necessarily another ground of inadmissibility that applies), because, the theory goes, the negative factor makes it harder to convince the officer that you don't intend to immigrate. This ground of inadmissibility doesn't apply to immigrant visas, so you don't have to worry about that.
(There was a rule on public charge inadmissibility that was released during the Trump administration, but it was vacated by the courts and is not in effect. See the USCIS page on public charge. Public charge inadmissibility is currently administered according to the 1999 interim field guidance. On page 28693, it says:
B. Benefits That May Not Be Considered for Public Charge Purposes
- Medicaid and other health insurance and health services (including public assistance for immunizations and for testing and treatment of
symptoms of communicable diseases; use of health clinics, short-term
rehabilitation services, and emergency medical services) other than
support for long- term institutional care,