How can the removal of stray dogs from public institutions be balanced with animal rights and public safety concerns?

The Supreme Court has ordered the removal of stray dogs from certain public places. I want to understand how authorities can ensure public safety without violating animal rights or creating new social issues.