Googling forums we can see that "SD card unexpectedly removed" is a common problem for HTC smartphones.
I wrote about that to HTC support and got an answer: "Unfortunately we don't recommend for this devise cards higher than class 6"
I think, it is quite disgraceful

for HTC, but this is an explanation and a way of solving the problem - to get class 6 card.