As David Siegel points out in his answer, (B) is ungrammatical because the verb "was" does not agree with the subject "they." I would like to discuss the difference between (A) and his sentence (C) ("Last night, while they were sleeping, a burglar broke into their house."):
There's nothing grammatically wrong with (A) per se, but the construction isn't appropriate for this sentence. When describing events in the past, we use the past simple to provide the main narrative and the past progressive to provide background information. Sentence (A) puts both clauses in the past simple, assigning equal significance to both the sleeping and the break-in.
Putting these two events on equal footing doesn't feel right because the listener (or reader) might guess that they slept last night (since that's what people usually do at night), but is probably surprised to learn of the burglary. (C) does a better job pointing out which part of the sentence is of more interest, and should therefore be the preferred construction in this context.
It is possible to come up with another statement for which construction (A) could be appropriate: "While I sang, John played the banjo." In this sentence, the singing and the playing are noted to be of equal importance. This would be the appropriate construction if my actions and John's are new information of equal interest to the audience or both important for the telling of a narrative.
Contrast the same statement with construction (B/C): "While I was singing, John played the banjo." This sentence might be preferred if the audience already knows that I sing often or were particularly interested in what John was doing or if John is more relevant to the narrative than I am.