I didn't merge any cells -- just created a new worksheet and pasted the Evernote table into it. But I looked closely at the table, and I saw that there was an extra row between two rows of text, which starts at column 3, so apparently somehow it got merged when pasting the table. I tried sorting again, but got the same message, so I looked again, and found several more rows with merged cells, and fixed them, and then finally I was able to sort. It worked, except for two unsorted rows at the top (no, they didn't have spaces in front of the words). I retyped the content of those rows at the bottom, and deleted the two unsorted rows at the top, and then finally I was able to get the whole table sorted. I deleted the original Evernote table, and pasted in the sorted one, so now I have a sorted table. This whole process is quite time-consuming, so I think that I will just insert a row at the right place when adding new rows in future.
It would be a lot easier if there was a native sort in Evernote.