I buy/sell electronics and often end up with extra SD cards and things like that. Recently tried some of the little 2GB micro SD cards I had and they have the same issue you described.
Now matter what device they were in the would only be recognized some of the time. I formatted them multiple times, in Windows and Android.
Currently using a PNY class 6 16GB without any issue.
Probably just a bad SD card. You can find 8GB around the web for a few bucks, 16GB for around $10 and you can usually find 32GB for around $20.