The word Alcázar comes from arab al-qasr and the meaning is more or less the same than castle or fortification, although it has a second meaning that is Casa Real or prince's room (I think Reales Alcazares of Seville are more a palace than a castle).
I don`t know why we call either Alcázar or Castillo to a fortification, but as far as I know, the alcázares of Toledo and Segovia are much bigger and modern than those castles from the middle age, and architectonically very different.