Well, they did just spend weeks agonizing over the decision to defend the prison, so I can understand not wanting to give it up. Plus, Woodbury takes a lot more people to secure the perimeter -- a 24x7 cadre of armed guards -- that Rick's group really can't afford to dedicate to that task.
The people left behind in town were very explicitly shown as virtually helpless; everyone who could carry a gun is now dead.. If Rick decided they simply didn't have the manpower to defend the town, there was a simple humanitarian decision to be made: rescue the people, or leave them to die.
Rick's return to conscience and humanity -- and the contrast with Carl's growing coldness -- was a central theme of the last few episodes. I get why rescuing the townsfolk was an important decision to make.
As for water and power, Woodbury must have been using generators, no? They can be moved to the prison (or didn't we see that the prison has its own generators, and they're working?). And if the town has water, why wouldn't the prison?
It's already been discussed that the prison has fenced-in land for agriculture, something the town lacks. And old folks are handy for child care, and kids are handy for farming and other chores. This will free up the core group for defense, hunting, walker control, exploration, etc.