I've had a similar problem.
When i added a website the Vhosts file wasn't updated.
Somehow on one of my domains there was an extra space 'www.domain.ltd '
I've tried removing it using the form but without success, i searched in the database and removed the space manually. Now when i create a new site it writes the new file as expected.
@Till & Falko -> You should use trim() in your script before inserting / updating the form fields! Just a tip!