A high-resolution sensor behind the wrong lens still produces a soft, distorted, or incorrectly framed image. The lens sets the field of view, how much working distance you have to the part, how sharp the image stays across that field, and how faithfully a measurement in pixels converts back to a real-world dimension.
We select lenses the same way we select cameras — starting from the part, the required accuracy, and the space available on the machine — rather than defaulting to whatever ships with the camera.