The soft iron is used as the core of an electromagnet because
it can produce stronger magnetic field
it can easily get demagnetized
The soft iron inside the coil makes the magnetic field stronger because it becomes a magnet itself when the current is flowing. It loses its magnetism as soon as the current stops flowing.