The first time a files is saved (and that includes when converting a legacy file to a new version or creating a file from a template), InDesign always defaults to the last folder where a Save As operation was performed. Once the file has been saved further save operations should default to the current folder. If you export the PDF to a different folder from the one where the .indd file resides, then save the .indd, that information will be written into the file and the program will always default to the new location for exporting that file.
Often the used OS and its setting have an impact where the file will be saved automatically. On the Mac I recommend to use Default Folder from St. Clair Software which helps to adapt easy file selecting and saving.