There must be. Football is there to make the masses cheer, to act like an enhancer of local culture and a recognizable brand of a region. It's also an ambassador that can greatly influence the attractivity of a region, or people. Madrid get their money from the Spanish
state, therefore it's only normal that they pay attention to the situation of football in other regions of Spain too. It's not a moral obligation, it's almost payback for the generosity they benefit from.
Now, even in places clubs don't directly get help from the state, a non-written principle of solidarity applies, just like when
Bayern saved Dortmund from bankruptcy by lending money to it to honour short-term bills.
I don't dislike Madrid but their selfish behaviour is sociopathic in the strict sense. Add to that they can't win titles and mismanage their money and you have a
national problem. I am almost 100% positive Real Madrid has a more negative than positive effect on the Spanish economy and international perception. But that must be measured with relevant metrics at hand.