We use the verb 'be' in the first sentence because the word 'married' is an adjective. Adjectives (like happy, sad, rich, tired, and so on) need the verb 'be'.
They are married. (present simple)
They have been married for 30 years. (present perfect).
This would be similar to saying, for example, "How long have you been ill?" or "How long have you been unhappy?". In these sentences, "been" is nothing to do with travelling anywhere - it is used to describe a continuing state.
I hope that helps.