Three key reasons, two minor and one large. The first minor reason is Russia also has about 5 times the corruption Ukraine has.

Wealthy Russians are wealthy for a reason
While yes, Russia has a massive advantage in war materiel, a lot of it goes down the pit of corruption. Ukraine has their own problems there, but they are somewhat smaller and thus Russia loses more to corruption. The second small reason is Ukraine is aided by the worlds’ foremost military powers and thus the Russian advantage in weapons and equipment is lessened substantially.
The major reason is Ukrainians know the alternative to war is death. Russians showed this very clearly in the opening days of war with mass rapes, murder, torture and wanton destruction. Towns taken by Russians are turned into dystopian hellholes for the survivors. Woe onto you if you don’t want to speak Russian or be a loyal Russian citizen. Children are taken away from their parents and fostered in Russia.
These are all war crimes and crimes against humanity, but Russians revel in it. That gives Ukrainians impetus to fight, at worst they die trying to prevent an even worse fate. Russians fight for money, their motivation are the large sign-up bonuses and promised wages that may never materialise. They do the bare minimum requried and try hard not to die.
Ukraine compounds this by prioritizing lower losses. Russians prioritize gains at all costs, leading to senseless assaults by poorly motivated, poorly trained forces that just leads to grotesque losses. Occasionally they score minor successes too, although I will notice their last victory of operational significance was over a year ago at this point. They used to take two operational goals per year, but haven’t yet delivered on one this year.
I’ll just quote what my immediate manager at Microsoft always said, whenever we discussed his managers:
Because they’re useless idiots.
There are mitigating circumstances here, though:
- Russia has a military budget on paper, but in reality, huge amounts are embezzled.
- Russian soldiers are fighting a war abroad for very unclear purposes, which is crap for morale.
- The Russian military has, for decades, actively punished competence and rewarded incompetence, because the last thing Putin wanted was a competent military. They would inevitably realise that they were better at running the country than Putin and retire him out a window.
So there are at least reasons why they are useless idiots. They didn’t actually decide to be, they were head-hunted for uselessness.