There are many different considerations when making educational choices, including but not limited to location, cost, and reputation. It makes sense to go to the best school that meets your educational wants and needs as well as aligns with your current situation.
With all things equal, however, as you mature and move through the higher educational system, you typically associate yourself with the last degree program and institution you attended. For example, you would associate with your undergraduate institution until you completed your masters degree, and your masters degree until you completed your doctorate. Of course, you may always be active in your alumni associations and with the many people that you meet and befriend along the way, but in general many consider their last alma mater as the one to which they most identify.
In keeping with this philosophy, it would make more sense to focus on a higher ranked, possibly more well-known, institution for your masters degree, if indeed you knew that you would be pursuing a masters upon completion of your undergrad. Your undergraduate institution and your experiences there, however, develop and shape your educational foundation for further education, so selecting the best overall school that meets your educational wants and needs as well as aligns with your current situation is the best bet.
I hope this helps! Wishing you the best in your educational endeavors --