IS was created by US and it allies to topple Syria president. When it failed, IS searched for other target and went out of control. It tried to invade Iraq.
US then approached Iran for a assistance. Soleimsni was that general US worked with, and later assassinate him after IS was defeated.
Reason.
Suleimani was negotiating a peace with remnants of IS troopers.