I would not mind getting a more complete answer to this, but it's pretty easy to guess it for backward compatibility. the close-on-exec flag should have been entered sometime. The code that existed before this time did not know about it and would not work correctly if it had not been changed. Therefore, it is disabled by default.
Unfortunately, errors occur because of this, the daemon process that opens cgi can leave the socket open for listening, and if cgi does not shut down or close it, the daemon cannot be restarted. Therefore, I agree with you that this is not a very good default.
source share