Out of desperation to end the war!
It was certainly not their first choice.
Wilhelm and Nicholas were cousins and on good personal terms.
They tried to avoid the war but failed to get their respective “governments” under control. Shows even for monarchies they sure had their governing limitations.
They may have thought that they had a good reason to do it (though I’d argue in hindsight no possible reason could have justified what they caused).
But that’s not my point. My point was the poster was speculating about how much better we would be if Germany won and the Bolsheviks were crushed, but was seemingly unaware of the basic facts surrounding the history of the events they are speculating about.