I suspect the rules and motivations will vary from country to country. Starting with the rules, for example, ANR 25 (1) specifies that:
A person shall not smoke anywhere in a prescribed aircraft.
While ANR 25 (6) specifies that:
prescribed aircraft means an aircraft that:
(a) is a regular public transport aircraft, or an open‑use charter aircraft; and
(b) is engaged in:
(i) the carriage of passengers between airports in Australian territory; or
(ii) Australian international carriage (except the carriage of freight only)
That effectively criminalises smoking on scheduled domestic and international flights as well as charter flights.
In addition, CAR 255 states:
(1) Subject to subregulation (1A), a person must not smoke:
(a) in a part of an aircraft in which a notice is permanently displayed indicating that smoking is prohibited at all times or without specifying a period during which smoking is prohibited;
(b) anywhere in an aircraft during take-off, landing or refuelling or during a period:
(i) in which a notice is temporarily displayed indicating that smoking is prohibited; or
(ii) which is specified in a permanently displayed notice as a period during which smoking is prohibited;
Which effectively criminalises smoking on any aircraft where any kind of no smoking sign has been placed.
The reasons stated for the smoking ban vary (and are not usually stated in the laws or regulations themselves), but generally include (1) safety of air crew and passengers, (2) cost savings for airlines and (3) eliminating conflict between smoking and non-smoking passengers.