Should the verb in the following sentences be singular or plural?
Two cups of sugar [was or were] added to the recipe.
Fifty cubic yards of contaminated soil [was or were] excavated.
Should the verb in the following sentences be singular or plural?
Two cups of sugar [was or were] added to the recipe.
Fifty cubic yards of contaminated soil [was or were] excavated.
Typically, with units of measure, one uses a singular verb. For example, if you are most interested in a single quantity of sugar, that happens to be two cups, you would say two cups of sugar was added to the recipe. In fact, it might have been half of a 1-quart measure, or it might have been four half-cup measures.
Almost certainly, you are uninterested in whether the fifty cubic yards of earth was added in fifty increments or otherwise.
See, for example https://www.aje.com/en/author-resources/articles/editing-tip-singular-and-plural-verbs-measured-quantities.
Consider also the following sentences:
*Two cups are too much sugar for that recipe!
Two cups is too much sugar for that recipe!
*Fifty cubic yards were a lot more contaminated soil than we anticipated.
Fifty cubic yards was a lot more contaminated soil than we anticipated.
As an aside, you can avoid this by using the active voice, which many style guides prefer when a choice is possible:
The baker added two cups of sugar to the recipe.
The contractor excavated 50 cubic yards of soil.
Don't let the prepositional phrase (of sugar, of contaminated soil) fool you. The subject-verb agreement depends on the base noun. So you have:
Two cups were added...
Fifty cubic yards were excavated...
In each case, the base noun is plural. The adjectival prepositional phrases that complete the noun phrase are of no import.
For reference, see point 5 at this OWL link.