How can I attach a security gate where there are no studs?
You need to mount it in studs, concrete or something else that can handle the load; drywall by itself will not.

If there are no studs available where you want to mount it, you can open up the wall and either install a stud at that location, or depending on how the gate mounts, you might be able to add bracing between two existing studs and then mount to that.

I wouldn't be too concerned with the metal corner bead, you can screw through it pretty easily.

You might also be able to put up a seperate structure (ie: mounting a metal pole in concrete, etc.) to support the gate.