There are many different theories:
The word “HAM” as applied to 1908 was the station CALL of the first amateur wireless station operated by some amateurs of the Harvard Radio Club. They were Albert S. Hyman, Bob Almy, and Poogie Murray. At first they called their station “HYMAN-ALMY-MURRAY”. Tapping out such a long name in code soon became tiresome and called for a revision. They changed it to “HY-AL-MY”, using the first two letters of each of their names. Early in 1901 some confusion resulted between signal from amateur wireless station “HY-ALMU” and a Mexican ship named “HYALMO”. They then decided to use only the first letter of each name and the station CALL became “HAM”.
In the early pioneer days of unregulated radio amateur operators picked their own frequency and call letters. Then as now, some amateurs had better signals than commercial stations. The resulting interference came to the attention of congressional committees in Washington and Congress gave much time to proposed legislation designed to critically limit amateur radio activity.
More can be found on Wikipedia.