That was actually just the reason people largely didn't smile in photographs... They considered them very important occasions. Most people never had their photograph taken in their life, and so the idea of smiling for no apparent reason wasn't something that somebody would think to do.
Also, exposure times were long. Maintaining a smile throughout that whole time might be difficult and could ruin the photo if you moved or let the smile down.
A photo might be given the same importance as somebody being painted, and that this is going to be a record of you for all time. So, somebody who's doing something that's going to be preserved for future generations would want to look dignified, thoughtful, or serious.
The best quote is by Mark Twain who summed it up...
The smile in photographs seems like it'll be something that lasts into future generations, but there could very well be a time when somebody in some future generation looks back from 1940 to 2050 and says "Why the hell were people ALWAYS smiling in photographs...? Don't they know they look ridiculous?"