Permissions issue.
If you have set a setgid I.e g+s on the folder and wondering why the created files are owned by www-data:www-data, note that uploaded files are first saved in /tmp folder with the web user.
The move_uploaded_file() command moves the files from /tmp to the given TO directory, including the current permissions the /temp file has.
Hence the setgid gets ignored and doesn't inherit the parent permissions.