The messer would make sense as a peasant weapon then but why were nobles and knights carrying these instead of swords?This could be an article in itself. The short answer is that there is artwork, and even source manuscripts. We briefly touch on this in the Path of the Saber article on the site, from the 'Learn HEMA' section.
It is popularly believed that messers were primarily utilized by burghers to get around certain laws prohibiting the carry of a sword, with the thinking that a messer was instead classified as a "knife" but some of this is speculation. There is a lot of speculation on this subject, with some lengthier threads like this one over at ARMA being very representative of what that speculation looks like.
What does seem clear is that they were easier to make than double edged straight bladed swords and so being more affordable could mean they were more plentiful.