You can remember the meaning of 同志 with this easy mnemonic:
Whether my friends are heterosexuals or homosexuals, they are the same (同) to me. I consider them my comrades as long as we share similar values and wills (志).
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.