As far as I know the Prophet of Islam (pbuh) mostly fought defensive wars while after death of Prophet, Muslim caliphs began a journey to conquer land after land and to bring territories under their control. How this can be justified? Is it allowed for a ruler to attack a neighboring land on the pretext of spreading Islam? I see because of such military engagements (e.g. Muhammad bin Qasim and Ghauri in India) many non-Muslims believe that Islam was spread by sword. It is also interesting to note that Ali who was at forefront during all wars of Prophet never participated in any such wars during reign of first three caliphs nor did he himself initiate any such new battle. Also to be noted that his progeny kept themselves away from leading such exercises. For some of those drills there may be local reasons or context but to say that in all the cases Muslims were provoked to attack neighboring land cannot be accepted while we also know that many of such warriors who conquered non-Muslim lands also fought with Muslim rules to bring them under their subjugation and they did not hesitate to spill blood of fellow Muslims in such cases. One example is Salahudin Ayyubi who ended Fatimide dynasty in Egypt. How can one support military expansion of such people on non-Muslim lands?
Both Shia and Sunni point of views are welcome.