"went off" means that is started or triggered. It is an idiom.
If an alarm goes off, that means it starts sending out whatever signal it's supposed to - by loud noise, light or message.
If a bomb goes off, that means that it explodes.
You are right that "go off" would most logically be interpreted as turning off. However, as we all know, language many times is totally illogical.
If the alarm turned itself off or turned itself off, we would say that or "the alarm stopped".