Sheet music became commonplace in homes starting about 1840. Postcards came along some years later, but when the songwriters put their pens to a score postcards and music were a perfect match.
The universe is a competitive place. When you say that your town is the most beautiful, or when your “doohickey” is the largest, or your “thingamabob” is the most whatever, the rest of the world may not believe what you say, so you better have a postcard to prove it.