Correct option is B
I didn’t sleep well last night because the dog is barking.
The error is in the tense agreement.
The phrase "the dog is barking" should be in the past tense "the dog was barking" to match the past tense narrative of the main clause about not sleeping well last night.
Example: I didn’t go out last night because it was raining.