I'm trying to connect plumbing up for a toilet in a cell, but the game won't let me build a small or large pipe here. Is there a reason why?
You are likely playing with gangs enabled. You are not able to build in cells or rooms occupied by a gang. This sadly also means that when a gang member is assigned to a cell while you are still adding the infrastructure, you are no longer able to build that as well.
Gain visibility on the cell if you don't already have that by selecting a guard and right-clicking in the cell. Click the prisoner, and right-click on a different cell that has no gang-member in it. The prisoner is transfered, allowing you to build in that cell again.
The following images show the issue with in-game screenshots.
When one is unable to build pipes through a cell... http://images.akamai.steamusercontent.com/ugc/396676045196404958/8D886A8BD5C5AA4CBAC4A24DEF60AC182BA84664/?interpolation=lanczos-none&output-format=jpeg&output-quality=95&fit=inside|1024:576&composite-to=*,*|1024:576&background-color=black
...that cell might be occupied with a gang member http://images.akamai.steamusercontent.com/ugc/396676045196404185/ED98E76FF0198CB0E2C933AE4E8F6EAAB44CCCC9/?interpolation=lanczos-none&output-format=jpeg&output-quality=95&fit=inside|1024:576&composite-to=*,*|1024:576&background-color=black