Hello and welcome. So much about dementia is unfair and when it comes to money the same applies. My thoughts are that as the shares are in your husband's name then the money is his and as such will be regarded as an asset along with the remaining assets and as such will cover his care.
Hopefully someone will come along and blow my theory right out of the water, fingers crossed for you.