They are magnets, they just require power, and thus have positive and negative poles.
This is true, but practical (strong) electromagnets are not exactly like permanent magnets, even aside from the current.
In an ideal theoretical electromagnet, the magnetic field is only created by the flow of current, with the poles being determined by the right hand rule.
But this magnetism is relatively weak when relying on just coiled wire at nominal current. So most electromagnets ‘cheat’ : they have an iron core which multiplies their effect many times.
Atoms in iron are free agents, they will align themselves with a nearby magnetic force easily. This creates the entire magnet.
This method works well when, in the case of access control, you are binding (attracting) the magnet to a steel plate. The steel plate succumbs and aligns itself with the electromagnet.
However curious things happen when trying to make electromagnets repel. Because the atoms in iron are free agents, if they are presented multiple offers of opposite alignments, they will choose the strongest one.
A simple experiment can confirm this:
1. Take an access control maglock which is not energized and not touching the plate.
2. Place a small neo disc magnet directly on the maglock, with north showing, without regard to electrical polarity.
3. Energize the maglock.
4. Note that the disc is still stuck to the maglock.
5. De-energize the maglock
6. Flip the disc magnet
7. Re-energize the maglock
The magnet will still be stuck to the maglock, but with south showing.