Is foulness used to mean the same thing in the next two sentences?

His display of foulness deserved severe punishment.

Mouths which speak such foulness must be cleansed.
the same meaning