https://www.ecfr.gov/current/title-14/chapter-I/subchapter-C...
- The alarm will alert flight attendants to the situation, allow them to identify the violator of the non-smoking regulation, of the potentially hazardous situation (open flame in an aircraft), and if necessary bar the person from future flights.
- The ashtray will likely prevent a lit cigarette from burning down the aircraft in flight if improperly disposed of with, say, dry paper trash.
A smouldering cigarette in a rubbish bin could imperil the entire flight, passenger manifest, and crew.
Smoking culture was a contributing cause since it made fires in trash bins so common that the pilots didn't react with urgency to a fire that looked like that (but in that case was definitely not).
Having smoke alarms was absolutely the correct response, because smoking is by no means the only cause of fires on airplanes. In fact, I'm not even sure there has been a single fatal crash involving fire that has been definitely caused by smoking, but there are many that are known to have been caused by other things, such as Nigeria Airways Flight 2120, Swissair flight 111, ValuJet flight 592 and China Airlines Flight 120.