There are two reasons why Diamond can say this.
First, Diamond can say this because the historical record backs him up. There is no evidence of writing among people who do not have agriculture. It is possible that people were writing on things that decayed and can no longer be found, but we have no evidence of this. Therefore, Diamond can say that writing comes after food production.
Second, Diamond can say this because it makes sense theoretically. In a hunter-gatherer society, everyone is busy getting food. They do not have enough food to let people do other things. With agriculture, fewer people can produce more food. Now, there is a surplus that can support people who are not occupied with getting food. This means that some people will have the time to do things like inventing writing. In addition, there are now more people living together in one place. Government is needed. It becomes important to have records kept of things like who has paid how much in taxes. This is when writing becomes necessary.
For these reasons, Diamond can say that food production comes before writing.