I believe it was purely for reasons of expansion. I don't know exactly what our response should have been, but we need to at least acknowledge that Ukraine is defending their sovereignty and Putin/Russia are the aggressors. We should support them at least minimally.
I won't argue against the idea of sending aid to Ukraine on principle, but I will just mention a few considerations:
Ukraine relies on conscription. Men are being arrested off the street to join the front lines. Millions of men have fled the country, and are now being hunted down in the places they fled to src. In supporting Ukraine's military, the US and EU allies are inadvertently supporting military slavery.
The Ukrainian government has a corruption issue, and it is likely that a lot of the aid being sent is being embezzled. src 1src 2
Point 1 could be rectified by conditioning aid on reversing the draft. Point 2 may be more difficult to address.
Of course Russia uses conscription as well. In fact don't most countries that go to war use conscription? I don't like it but, if we can stop it here then the next country that Russia might invade wouldn't have to draft soldiers.
I mean it doesn't seem like too big an ask to require the country you're arming not to do slavery. If they want the weapons that badly I'm sure it will work.