LA is one of these places.
If you place them in custody, you might as well provide them with some basic housing that costs less than jail. They have literally nothing to lose from fines, court dates, tickets, probation. They don't have a toilet, what else are you going to take away from them.
The police are correctly judging that the need to defecate is not a criminal problem.
Find a public toilet or use a restaurant/shopping mall toilet.
By definition, if there is a public toilet accessible to you, or you are welcome in a restaurant toilet without paying, you have somewhere to go to the toilet.
But otherwise it just looks like they don't even want to try. In a normal small community police or you would try to find out who it belongs to, not just give up. :)