I believe one of the rescue crew members triggered the explosion to destroy the ship as they escaped. I think it's a horror movie, but I could be wrong. I first thought it was Event Horizon a 90s film with Laurence Fishbourne, but watched that a couple of days ago and that has a different ending where they stay on the ship and a rescue crew arrives for them.