Dude, that was a war, fought in ral battle field. Even Sahaba did it, entering into kuffar's army with intention of getting killed but killing many before dying ..
Rules of battlefield are different in Islam, attacking innocent civilians is an act of cowardliness
The intention was not of 'getting killed', but 'kill as many as possible' without caring to save their own life. That is the twist given by fanatics to justify suicide bombing.