I don't see the goblins at Gringotts as innocent. They knew perfectly well that Bellatrix was a Death Eater and acting in the service of Voldemort. They are about as innocent as the Swiss bankers that did business with the Third Reich.
If an Allied pilot had flown over Switzerland and bombed some of the banks there, do you think a courts martial would have accepted such a justification?
Most Swiss bankers were innocent. True, they were no doubt aware that some of the money they handled was dirty, but most car dealers today are no less aware that some of the cars they sell will be used by dangerously drunk drivers. Does that mean they are complicit in homicide?
Besides, there may have been other ways to deal with the horcrux. A horcrux which is sitting in a bank vault where nobody can get to it won't do very much if nobody can access it. If Beatrix Lestrange and Voldemort were killed while the cup was still at Gringotts, it should have been possible for the Ministry to destroy it afterward I would think.