Opinions will vary. If moving is an option and you want to play it absolutely safe than I'd probably recommend going elsewhere. If there is just that "perfect fit" at your UG institution though its worth a try. It probably matters more if you are going academic versus a purely clinical career.
This isn't a black & white thing (though some people have very strong opinions) so like anything I think its going to boil down to gradations, goals, etc. I'd give it consideration when looking at schools but EVERYTHING has pluses and minuses when it comes to school choice so this is just one of many factors you should think about and its not something that should drive your decision.
Personally, I'm an advocate of branching out. Dr. E brought up one reason why. It may help with networking since it forces you to "meet" more folks in the field. I also think its helpful to work with different labs in your area and see how different people do things. Is it absolutely critical and anyone who doesn't do so is destined to be an incompetent failure who will never do good research? Of course not. However, I'm generally an advocate for getting varied experiences (be it a different UG and grad institute, doing practicums in multiple locations, or whatever else). Obviously that's something to strive for, but we can't base our entire lives around doing new things whenever possible and sacrificing everything else to make it happen. Hence - its a consideration, but not the end-all, be-all.