Barry, while moral, is a super powered vigilante out of a sense of moral duty (With Great Power comes some thing something, to misquote that other franchise). He has grown up victimized by a super powered villain, giving him a complex about what's right, not necessarily what's legal. When he first puts someone in the particle accelerator, it's out of pure necessity. Where else will they put someone with super powers? Regular jail won't hold them, as you can see throughout the season:
Multiple break in and break outs happen at Iron Heights, by The Reverse Flash, by the teleporting girl, and by non supers with super weapons like Snart and Heatwave.
They constantly mention how bad of an idea the jail is, and when Detective West finds out, he calls Barry out on it, his captain bluntly calls it a human rights violation, they compare Barry to that green guy with an anger problem that shoots people with arrows and has a private prison island. Eventually they try to transfer the evil metas to said prison with the help of the black ops government group Argus but Barry is foiled by his own petards and they all escape.
Eventually, the Star Labs scoobies provide the civilian police the technology to suppress meta powers at Iron Heights, once the police publicly acknowledge Metas existence and form the Meta Human Task Group. Which allows the heroes to regain the moral high ground.
As to eating, we see them bring some of the prisoners fast food in season 2. The bathroom is not discussed, as per normal on tv and movies, but there was a twitter or tumbler post saying that Cisco also built a head into the prison cells.