The number "25" indeed comes from the fact that it was the 25th compound of the lysergic acid amide series or lysergamides. I found an article* by Frank J. Ayd, Jr. & Barry Blackwell who accounted Alexander Hoffman's investigation in his LSD synthesis:
A number of pharmacological experiments were carried out by Professor
Ernst Rothlin with this new compound, which was given the laboratory
code name LSD-25 because it was the twenty-fifth compound of the
lysergic acid amide series.
You can check the other compounds of the series in the Wikipedia article linked above. Most of them have their own specific names and not LSD-1, LSD-2 etc.
I also did find something in an e-book(Ref) which says that the number has something to do with date:
Dr. Hoffmann described the results of accidental ingestion of
LSD. It was in Switzerland in 1943, five years after Dr. Hoffmann and
an associate has synthesized lysergic acid diethylamide tartarate
(from ergot). The substance was labeled "25" because of the date: "May
2, 1938" (the date when LSD was synthesized(?)).
Ref.: LSD-25: a Factual Account: Layman's Guide to the Pharmacology, Physiology, Psychology, and Sociology of LSD, Louise G. Richards, U.S. Bureau of Narcotics and Dangerous Drugs, 1969
*I was researching about something else i.e "serendipity in Chemistry". While I was surfing the Internet, I stumbled upon this article and from that, I came to know about LSD, searched for the sources of their information and from there I got access to the above article and then proceeded to compile this answer without any prior intentions. What a beautiful irony!