some people use it in illegal transactions hence the misconception of it being illegal. but it is not illegal worldwide. there are countries that prohibit the use/transactions of it maybe because of it being widely used in illegal transactions but that doesn't mean it is actually illegal.
In other words government announce that bitcoin is illegal because this is not controlled by laws. And there will be lots of investors who are succeesfully invested bitcoin without any tax payment because of decentralized profile that nobody could regulate it.