Here's a reference for you:
Temporary Databases[
^]
The bottom line is that SQL Compact will use temporary files even for queries.
If you're running the database with a user account (which might not have write permissions to Program Files), you might want to change the database location to a directory where users can access, such as the user's AppData folder.