If Viserion is
undead and rotting, which he is as you can see the holes in his wings,
wouldn't it be very hard for him to maintain altitude?
Magic is not the correct answer here, in my opinion. There are many things about the dragons that can be answered by magic:
Note that I didn't mention "why dragons breathe fire". There seems to be a semi-scientific approach here. When you look into a dragon's mouth, you see two little holes at the back of the jawline. This is the source of the dragon's fire, it basically functions like a blowtorch. So there is at least some explanation as to how they breathe fire, it's not just magic.
However, the dragon's flight has always been shown as realistic flight, basing itself on the principles of physics.
For these reasons, I'm arguing that in regards to dragons' flight, magic is not a valid answer.
So how can Viserion fly with holes in his wings?
First of all, the holes aren't that big. They are little holes compared to the total surface area of his remaining wing.
Somewhat offtopic but relevant as to the core of your question: wights don't seem to rot much after resurrection (as far as we've seen, which is little to go on to be honest), so it's possible that Viserion isn't actively rotting because he hasn't been dead for long enough. I am not arguing that I know for a fact that he isn't rotting; I'm just arguing that you can't know for a fact that he is.
You're right that Viserion should be less efficient at flying with holes in his wings (compared to Viserion without holes), but he shouldn't be incapable of doing so (unless the holes are big enough, which does not seem to be the case from what we have seen so far).
But his movement is through necromancy?
You need to distinguish between the source of the movement and the effect of the movement.
Necromancy animates these wights.
As Melisandre said, the necromancy makes the wights move. But that does not mean that every consequence of this movement is also caused by necromancy.
If a wight swings a sword, hits a soldier and cuts his skin, did necromancy cut that man's skin? No, it did not. The sword did.
That sword would have cut that skin regardless of who swung the sword.
Now applying the same to Viserion:
But how does he fly then?
Coming back to my earlier point, you're right that zombie Viserion should be less efficient at flying (compared to Viserion), but he shouldn't be incapable of doing so.
Physical flight works under the following (drastically simplified) principle:
Lift force = drag of the wing * force of flapping the wing.
To achieve the same lift (flight capabilities), if zombie Viserion has a lower wing drag (due to the holes), he can make up for it by putting more force behind his wing.
This would mean that in practice, zombie Viserion would flap his wing faster than he used to. This detail may have been omitted from the show because the animators did not consider it to such a detailed degree.
Let's look at the wights again, specifically the skeletal ones. While they are relatively easily smashed to pieces, they are still capable of swinging a sword without ripping themselves apart. If their strength only came from their physical structure, then they would probably fall apart at the first swing.
So it stands to reason that necromancy (the force that moves their bones) adds a bit of extra force to their movement. It then also stands to reason that Viserion can be stronger than he was before, which can explain the added force needed to flap his wing.
It's likewise impossible for zombies to walk with no blood pumping through their veins and no way for them to move huge distances with no source of energy, nor does it make sense that they could run, carry heavy weapons, be strong enough to strangle people, but are somehow incapable of swimming. Nor do the aerodynamics of the living dragons make a whole lot of sense.
Viserion can fly and zombies can fly for the same reason undead dragons and wights exist in the first place: magic. You'd be disappointed seeking a realistic answer based on real physics.
The only answer would be magic. The Others are magical beings, and now Viserion is too.
Dragons are unreal.
In real world, it would be nearly impossible to create anything heavier than a pig that flies. Many fantasies just say "it's a dragon" and don't even try to explain how do they fly or breathe fire/acid/cookies/smoke/snow/balloons/ice/magic/plasma/whatever. The only possible answer here would be "magic", or "divine power", whichever you prefer.
But the real answer is just "nobody thought they should bother with explaining it".
As for why it is impossible for any dragon to fly, see this thread at worldbuilding.se.
Viserion might be more like a White Walker, not a Wight, hence he is not undead and rotting.
Wights are undead corpses animated by magic. Corpses can be converted to wights merely by the Night King raising his arms.
Walkers are converted from living people (e.g. - often Craster's baby sons, but could be from other people too) when the Night King touches them.
The Night King touched the dragon to convert it rather than merely converting it from afar as he did with all the dead bodies at Hardhome.
So perhaps Viserion was not completely dead, but nearly so before he was converted. As the equivalent of a White Walker (Flyer?), he won't rot. He won't be bothered by fires that kill wights. He won't be killed by being chopped up by a sword (if enough swords could pierce his hide), but he might be vulnerable to dragonglass and dragonsteel as White Walkers are.