Как образовалось слово «глюк»? Различные источники утверждают, что оно произошло от слова «галлюцинация», но без дальнейших объяснений, а они так друг на друга не похожи
This word and its derivatives (приглючилось, глючный, глючить) originally belongs to slang of the Russian hippies community, which has been established a bit later then in western word, in 70s.
In its first meaning глюк was indeed just a shorthand for галлюцинация (hallucination) and has been used in context of drug usage.
As for the reasons why exactly this form has been adopted, I guess this word has been widely adopted because it is short, sounds funny to native speaker and at the same time can be easily used to produce new forms (such as mentioned above).
Gradually this word migrated to IT community which (to some extent) overlapped with hippies community. In IT slang this word acquires new meaning close to the word баг but not equivalent to it.