I see in your screenshots that it seems that you are using the "This activity acts as an example" feature.
Edit settings => Submission restrictions =>
This type of activity means that the teacher writes the code at the "Requested files" and the students can run the code, but cannot modify the code.
In this type of activity If you set a maximum number of files greater than the number of files that the teacher writes in the "Requested files", the system allows students to create new files but students cannot save or type in the files.I have added a new entry on the TODO list to avoid this miss-configuration.
If you are writing an "example activity" be sure to write in the "Requested files" the same number of files as the maximum. If you are writing a common activity remove the example option.