This is the 2008 Mutant Chronicles as was the answer to Oldish Scfi dystopian horror movie with monsters that have spikes for arms. I'll cannibalize my answer from there.
This is Mutant Chronicles, a greatly panned 2008 adaptation of the RPG by the same name, starring Ron Perlman.
The story is set in the year 2707. The world is loosely based on that of the Mutant Chronicles role-playing game, where many technologies are steam powered and mankind has exhausted Earth’s natural resources. The protagonists must battle against mutated humans that were accidentally unleashed.
The plot revolves around a "machine" which came from space 10,000 years ago. The "machine" mutates people into barely intelligent killing drones, known as "mutants", that drag new victims to the machine for conversion. Sealed away thousands of years ago by human tribes, the machine is accidentally uncovered during a large battle in Eastern Europe between two of the four corporations that now rule the world. Within six weeks the world is almost completely conquered by the mutant gangs. Some of the population has been evacuated to Mars, but millions remain on the doomed Earth. A group of soldiers are assembled to take another ancient device to the heart of the machine in an attempt to destroy it in a suicide mission. In return, their loved ones receive coveted tickets to Mars.
Indeed, the main hero does go through the machine, but his transformation is partial, and he winds up "saving" Earth by causing the machine to launch into space to another world.
And indeed, part of the transformation is spikes for arms.
And yes, the movie starts with someone trying to save their family by getting them on the evacuation ships.
The trailer shows the initial mutant assault and the evacuation: