The point is that if the ontological argument is valid then you can define all kinds of things into existence also. The devil is just an example, it could also be The Most Perfect Island, The Real Santa Claus and so on. So it is a reductio ad absurdum.
It doesn't refute it per se. It just shows that The Real Santa Claus also exists by the same token. Which is not really a logical contradiction so if you want to believe that, more power to you.
More generally, you can't attack the reasoning with any amount of imaginary horrors or delights. This is because the ontological argument doesn't try to argue imaginary things that are not God exist. Just that the imagination we have of God does exist, as the greatest thing ever. This is because of God's special property, that of being the greatest thing ever, that any imagination greater would just become the new God.
This property is not shared by things that are not God, such as Santa Claus. So you can't use the ontological argument for God to also show that Santa Claus exists. Santa Claus isn't the greatest thing ever, so Santa Claus isn't bound by the rules of logic to exist.