Lady Eowyn was able to kill him because the spell holding him to remain in the realm of the ringwraiths, did not apply to women or to halflings such as Merry or Pippin, one of whom was also with Eowyn when she killed the Witch King.