Be liberal in what you accept, and conservative in what you send. —Jon Postel
However, being strict in accepted input allows more options for extensions without breaking backward compatibility.
If a program used to be liberal in what it accepts, there might be programs that exploited this and relied on the program to continue being liberal (sort of relying on unspecified behavior). If this happens, it becomes hard for a program to change the meaning of previously unspecified input without breaking backward compatibility and existing programs.
This has partially happened to sqlite if you read Quirks, Caveats, and Gotchas In SQLite.