Because it gives the Krusty Krab a sort of “elite” feel. The Krusty Krab isn’t just a mere fast food restaurant, it’s the only fast food restaurant of its kind. Krabby Patties are an artisanal product made explicitly with love, as shown in the Spongebob vs. Neptune showdown, and going to the Krusty Krab on itself is an experience. Imagine the best burger place you’ve ever been to in your life; now imagine there’s only one in the entire world. If Mr. Krabs had built it in the middle of the city, the Krusty Krab would’ve just become another random dining spot; by placing it away, he makes it clear that the Krusty Krab is far beyond any food the city has, and the people going there feel like they’re on a journey, where the final reward is being able to eat a Krabby Patty. Call it whatever you want, but the fact is that Krabby Patties are so good that people are willing to eat them off the ground, and the restaurant being so far away improves that image of a unique experience.
Plankton, on the other hand, just didn’t make any market research and was trying to just copy Mr. Krabs.