What is 被 doing in sentence "这种病在三十年前就被根除了"? I understand that the sentence means something like "This disease was eradicated 30 years ago", but I have no idea what role does 被 have in it?

Is the sentence okay if we remove it? Does it convey any special meaning when present?
被 + verb = passive form

根除 = eradicate

被根除 = be eradicated

Some verbs have active form with passive meaning. 根除 is one of them. So it's fine to remove 被 from this sentence.

(These verbs are very similar to ergative verbs in English but mainstream Chinese grammar doesn't interpret them as ergative verbs.)