I found out that the cause was that somehow a line had been added to wp-config:
define(‘WP_TEMP_DIR’, ‘/home/path/path/path/public_html/wp-content/uploads/’);
This was a path that was on my previous site host, but not on my current one.
When I commented out this line, the plugin installer started working again.