What makes you think that it's illegal? Horse-drawn carts were still seen in city neighborhoods into the 1960s.
Most states have statutes forbidding animal-drawn vehicles on superhighways, but the only restrictions I've heard of for ordinary city streets generally are very localized prohibitions to deal with horse-drawn carriages serving the tourist trade.
To quote a provision that I think is typical, Michigan law treats them the same as any other vehicle:
A person riding an animal or driving an animal-drawn vehicle upon a roadway shall be granted all of the rights and shall be subject to all the duties, criminal penalties, and civil sanctions applicable to the driver of a vehicle by this chapter, except those provisions of this chapter which by their very nature may not have application.