This remedy of compelling a party to do something they agreed to do is called 'specific performance', and US courts only even consider doing this when real property (land) is involved.
For copyright infringement, generally what's available is injunctive relief preventing further infringement, disgorgement of profits, and statutory damages and attorneys fees as permitted by title 17. The injunction and disgorgement are the killers here that actually scare would-be infringers, and they mean that in most cases what you actually end up with is a settlement.