Everytime I tried to give them to a Pokemon of mine, it'll say "It won't have any effect."
Is there any logical explanation for this?
It's because that Pokemon already has 100 EVs in the stat that the Vitamin you're using increases. Vitamins only work for the first hundred EVs in each stat.
So, for example, if you used a Protein on a Pokemon that already has over 100 Attack EVs, that Protein would not work. This was most likely put into the game so that you couldn't just spam Vitamins on a Pokemon to make EV training easy.