Without knowing which web server you are running, I am assuming Apache. Similar configuration options exist for all of the popular web servers.
My first guess is that you have the directory linked and that the Index option is allowed for this directory or for the site as a whole. It may be that you do not have a link, however, Google is finding the directory index anyway. It is recommended that you at least check to see if the Index option exists within your Apache configuration file or within an existing .htaccess file within your web space.
In the Apache configuration file, either httpd.conf, 000-default.conf, or example.com.conf, the Options directive may have Index enabled where -Index is recommended. For most installations, the Apache configuration files can be found in
Information on the Options directive within the configuration file can be found on the Apache core page here: https://httpd.apache.org/docs/current/mod/core.html
This can also be controlled within the sites .htaccess file or within an .htaccess file located within the sub-directory.
The Options directive can also be used within the .htaccess file. Information on the .htaccess file can be found here: https://httpd.apache.org/docs/current/howto/htaccess.html