I rarely partake in these types of discussions mainly because I normally have no idea what the hell I’m talking about when it comes to Bionicle lore, but I feel like I can contribute my two cents to this one
Note: I’m not an astronomer or a physicist, I’m more of a biologist, so I might get some stuff here wrong
So, as far as I know, such thing as ‘perfect vacuum’ (vacuum with precisely 0% content of air in it) is a pretty hard thing to find in our universe. You’d have to fly countless of light years into the void of space to come across vacuum with such content of air.
The closer you are to a planetary body like the Earth, the higher the content of air in the vacuum of space will be, because, no matter what, air always tends to escape the atmosphere. That’s not really “nothing”, but still not a lot, we’re talking way less than a percent of air particles per cubic meter (you can do the conversion into murican football field units on your own, that’ll be your homework), which is definitely not nearly enough air for stuff like breathing (I know it’s crazy, but you actually can’t breathe in space), but maybe it’s just enough for a very powerful Toa of air to generate (with “an effort”) more air out of, using fictional robot elemental magic.
As far as I remember, Lewa and the company ended up in space relatively near one of the Magnas (can’t remember which exactly), which is a planet with an atmosphere consisting of air, and Lewa was a very powerful Toa at that point. So, all of my conditions are met here, so he can generate air without breaking any of the elemental power rules of the Bionicle universe.