Does bitcoin mining pay for the electricity spent?
That's the idea. Only hobbyists and weirdos mine for fun. The majority are in it to make money.
If you can't pay for it and make a profit too then you either have to keep mining and hope you can sell the coins you earn now for more down the line, but not many could sustain a loss over that much time as costs keep piling up, or give up and let someone who is profitable take your place.