When you ‘Add Media’ to a document, in the media library, with your item selected, you see a pane with options called ‘Attachment Details’
Within that pane is a field called ‘Link to’
Make sure it’s set to ‘Media File’ – that’s the setting that creates the link.