No one has job security in a bad economy or in an institution with poor leadership. Nor will tenure protect you from bad behavior.
Tenure isn't an absolute guarantee of a job.
Universities close. Wars happen. National politicians make bad decisions. Departments are closed fairly frequently in fact. And they are cut back for lack of students or research funding even more frequently.
Tenure protects you from being fired for what you say and think and write; not from everything. That is why it exists, not to make you comfortable.
Tenure exists so that you can properly follow your research even in to corners that offend other people, and especially important and influential people. It is a particularly strong form of free speech.
But tenure won't protect you in cases of misconduct and the actual treatment of others. This is the issue in the case cited. The professor has been charged with misconduct - with breaking rules and norms, not with what he has said or written. I won't and can't judge the case from afar, but tenure won't protect you from charges of, for example, pressuring junior colleagues in improper ways - coercion, extortion, and such.
The case of cutting someone for financial reasons is fairly common - especially if departments need to shrink for financial reasons. But if the university has competent management they are more likely to have a plan in place for such situations. In the US there have been cases of the university offering to "buy back" tenure for, say, a year's salary. This can be used to encourage older faculty to retire so that new faculty can be hired. But that takes planning. There is no job security in the face of incompetence of management unless there are laws that let, for example, governments step in. And that assumes government will be more competent.
However, in any decisions affecting your employment, you probably have rights at law. This depends on the country, of course, but most places such decisions can be contested within the university and/or outside it. In many places a decision on propriety might come down to intent. If the university moves funds around with the intent of getting rid of an individual it would be seen (and judged) as improper most places. So, tenure isn't the only right that an individual has in such situations though it often provides a presumption that you can remain employed.
There are abuses of the tenure system, but it is usually on the side of not firing someone who is being offensive - especially if they are being offensive outside their normal duties. There is currently a case in the news in the US (Indiana University) where a professor is being racist and otherwise offensive. The Chancellor of the university counters his comments in public very strongly, but refuses to attack his tenure. He stays. He can say what he likes. But others can also call his offenses out and they can do it without fear of loss of tenure.
If he is racist and spouts it he can probably keep his job, but if he acts it out, say by refusing to teach non-white students, then he would likely be gone in an instant.
I know of another odd case. A major university (R1) wanted to form a new department for an emerging field that overlapped some others. To form the initial faculty, administrators asked heads of those other departments to "contribute" faculty to the new department. What happened was that those departments sent over their tenured incompetents who they would have liked to fire, but could not. The individuals kept their tenure but the other departments were now free to hire better people. The new department struggled for quite a while but eventually overcame the original situation.