First of all, let me say this: do not take this answer as legal advice. I'm not a lawyer.
Let's analyze it a little bit. If you make a movie with that disclaimer and someone sues you, what's likely going to happen in court?
Now, it's true that things (especially legal things) change from country to country, and they change a great deal sometimes, but I think it's safe to assume that your lawyer could use this to help your case in court.
If the president in your movie is corrupted, you're not necessarily saying that the real one is too. You just want to preserve your freedom of creation, by saying "in my movie/story the president is corrupted", that's all. A movie should not be constrained by real world issues up to that point. Sure, there are some limits but those usually coincide with balance and common sense. Some TV series use this disclaimer, such as Cold Case or Law & Order. Unfortunately this is not what is always going to happen, and this is why if you're considering writing a book or making a movie, you should always make sure that the characters are unique enough, not only as characters per se, but also different from real life people that might consider themselves defamed by your work.
And if your movie is about a John Smith that robs a bank in New York, and you don't use the disclaimer, it's very likely every single John Smith will sue you for that. Using the disclaimer will improve your chances of avoiding lawsuits from every John Smith in the city.
But, there's a but.
However, if the two entities (real person and character) share too many things that might have them associated, then the director/creator might face legal consequences.
Creating a character and changing the name might not be enough, as there are many things that could help people associate two people that share other details: social background, ethnicity, particular episodes, appearance, job, etc. If someone knows the person you took inspiration from and, basing on details in the book, they can identify that person in that character you can end up being in trouble.
This is why the disclaimer is useful but doesn't make anyone invincible. And it should be clear that the disclaimer doesn't deny people from suing you. It can definitely happen, but it can be useful both before lawsuits (people won't care, after all, you said all characters are fictional), and during lawsuits. Yes, it should be used because it helps, but only meaning that it might help you in case of lawsuits, not that people will be 100% prevented from suing you.
You can read a bit more about it in its relevant Wikipedia page. To reiterate, the page states that it
is done to reduce the possibility of legal action for libel from any person who believes that he or she has been libeled via their portrayal in the work (whether portrayed under their real name or a different name)
however, very important (emphasis mine)
The wording of this disclaimer differs from jurisdiction to jurisdiction, and from country to country, as does its legal effectiveness.
As a lawsuit filed against Dick Wolf shows, we can see that such a disclaimer won't protect you and won't deny people from suing you if they deem it necessary.