Because 'y' is only sometimes a vowel, and although the word 'unicorn' starts with the letter 'u' which is always a vowel, it starts with a 'y' sound, and the 'y' sound in question is not a 'y' vowel sound.
Similarly, it would be "a universe" and "a unicycle."