This is not true. When cameras are first introduced to most societies, people don't smile for them. Often they even very intentionally stop smiling and adopt a serious/formal expression. Always smiling for the camera is a learned cultural behavior reinforced through pervasive social pressure, which took many decades to form and which was helped along by the heavy use of photography for advertising/propaganda where showing smiles increased sales, not a natural or predestined result.
That is a fair point. Back maybe 20 or 30 years ago, the average person would bring their camera on vacations and that was probably the extent of it. But it's a bit different now that most people carry a camera in their pocket so these moments of "fake" display are much more common.
Also, in the beginning it was not unusual that the only portrait of a person was post-mortem - to preserve the memory (as in 100 years of solitude). Difficult to smile in that case.
However, photographs were serious business for quite a while. You don't see people smiling on official portraits for the same reason. Imagine that portrait of Napoleon on a horse, but with a smile - doesn't have the same ring to it, does it?
Same for early photographs; they were expected to be solemn.