Regardless of the "formality" or "informality" of its usage, get is often used instead of be in the passive voice.
The principal difference in their usage is that get can be used to express actions and change and is only used with action, not state, verbs, whereas be can be used both with action and state verbs.
Expressing action, the passive with get makes it possible to differentiate between an action and a state if it is not otherwise clear:
The living room window was broken. (a state or an action)
The living room window got broken. (an action)
The passive with be and the agent mentioned also makes the distinction clear:
The living room window was broken by the burglar. (action)
Also, get is often used in the meanings of "to cause something to happen" and "become":
I’ll get your jacket cleaned if you like.
Let’s hope she gets better soon.
In addition, the get passive is also used in certain set expressions, such as
"get dressed", "get married", "get lost", etc.
I took a shower and got dressed.
When did they get married?
Have you ever got lost while travelling?
(The source.)