In acting, there is a difference between the character and the message.
An actor doesn't necessarily need to share the views of the character they are playing, but the film-maker might want them to be in tune with the aim of the film.
For example a film which is say anti-Thatcher may need an actor to play Maggie, but the director may (or may not of course) actually want someone to play her who actually believes Maggie is a baddie.