I'm guessing your home state is somewhere like Texas with lots of cheap, in-state schools but some legitimate concerns about your ability to participate in appropriate care for LGBT and HIV+ patients.
Residency is where you will learn the nitty gritty details of this area of medicine and caring for these patients, not so much medical school. In medical school, the main thing you'd learn about caring for this population is using inclusive language and strategies when taking histories and doing physicals. There are tons of online resources to learn about this topic if you find your medical school is not adequate in this area. You can also always do an away rotation at a place that focuses on this patient population/area of medicine if desired. I also wouldn't necessarily count on the state a school is located in having a direct correlation with learning opportunities for these topics in medical school. I would imagine many medical schools in Texas have LGBT student groups offering educational events and that sort of thing. In terms of things like when do we test for HIV, what meds do I put somebody on, what labs do I get and how often, what special screenings and counseling related to sexual health do LGBT patients need that cis/straight patients may not, how and when do I provide gender-affirming care, etc. - the bulk of that learning will happen in residency.
Maybe there are other factors at play here in your desire to leave your home state, in which case do what feels right for you. But I think for medical school specifically, the cost difference is probably not outweighed by the level of opportunity you will have to learn what you need to learn to take care of this patient population.