The other aspect is the early photos required long exposures. It is hard to maintain a smile or stand still long enough, so a neutral face was requested by the photographer. Daguerreotype's required upwards of 20 minutes!
Cameras tended to have long exposure times. If you have to hold a position for 30 seconds, it is easier to do so with a serious face than a laughing one.
There's this photo from 1901 which seems really modern: https://static.boredpanda.com/blog/wp-content/uploads/2019/0...
The speculation is that he didn't know about the culture of looking serious.