I wonder why your friends think switching to a company in close proximity is unprofessional? If you could ask them and edit your question with the reason that would be informative.
Basically, there is no good reason. There is no rule that career moves must be further than 20 feet ;-) Sometimes, it might be perceived as even more awkward when someone moves 1 floor feet to a different cubicle space with another team of same company!
Bottom line: don't worry about it. When you see former colleagues, smile and say Hi, and move on with your new job! Your friends are probably just jealous ;)
That said, the real issue is not whether it is unprofessional to move jobs that are in close geographic proximity (it is not), but how to do it without saying things during the transition period that might make one appear unprofessional in the eyes of others.
There are a few things that may be worth keeping (pitfalls to avoid) in mind to avoid the situation becoming a little awkward:
- When you are preparing to switch jobs, team members and other colleagues will ask you things like "Why are you going there?" and "Are you excited?" Also, for a few weeks or months after you make the switch, when you run into former colleagues on the street, they will ask questions like "So, how do you like your new job?"
These seemingly harmless questions are actually a test of your professionalism and integrity. Even if you are VERY excited and CAN'T WAIT to leave, I would advise against saying so.
Behaving as if moving to another job is the best thing that ever happened to you will inevitably make those that are staying behind feel uncomfortable and potentially demotivating. Without really knowing why, they might start to envy you. And envy is not a positive or healthy emotion to be inspiring in others.
Instead, I would recommend providing a calm, neutral response: "Yes, thank you for asking, I think it's a good opportunity for me and I look forward to learning new things and building some new skills." Don't go on and on about how great of an opportunity it is (even if it really is). Answer briefly and to the point. "Thank you, things are going well, I am settling in and the team is pretty good." That's it.
- Nobody really wants to hear how absolutely fantastic your new job is (compared to the old one), or how you "really really miss everyone" at your old job and "really enjoyed working with everyone" (if you really did, you would not have left). Such comments are always recognized as platitudes and are cheap and might only spark curiosity and more questions.
Besides, how will you feel if, after telling everyone for months how much your old job sucked and how awesome your new job is, something happens and your job becomes intolerable, or you find yourself laid off without warning? These things seem unlikely but, in fact, happen all the time. The less excited you appear about a new opportunity, the less explaining you'll have to do if it ends up not working out for you.
A wiser approach is to dispel any excitement and dismiss any additional questions about "how is it going" as quickly as possible so that everyone can move on with their jobs and lives. Staff changes are always perceived as rocking the boat a little, both in the old and new workplaces. Your job as the culprit responsible for the initial rocking is to do whatever you can to stabilize the boat and help things return back to normal.
Providing a calm, measured response to questions about your transition, whether these questions come from your immediate old colleagues, new colleagues, or even family, is a tactful and professional thing to do. Do it, and your transition will truly be smooth and cause minimum issues and emotions all around. Good luck!