1) The volume. The masks and other protective gear is volume-demanding cargo, since the overall density including packing (boxes) is low. The Boeing 777 Freighter (777F) has 518m3 of cargo volume on main deck [1], An-225 has 1200m3 [2], so the price per 1m3 of volume is 1930$ and 2500$ respectively (ratio 1.3).
2) The demand and the quarantine itself. During March-April demand on masks was enormous, everyone tried to buy them, some countries even tried to take over deliveries for other ones. China and many other countries were not accepting flights, so arranging even a single flight was challenging (thats why An-225 was flying through Almaty city that many times when making China-Europe routes, all other airports simply didn't accept any planes for transit and refueling). As a result, one huge plane was much more beneficial than 2-3 smaller ones.
[1] https://www.boeing.com/commercial/aeromagazine/articles/qtr_...
[2] https://www.antonov-airlines.com/our-fleet/an-225
Edit: correcting An-225 cargo volume from 1100m3 to 1200m3 using data from the official website.