Expel can be sometimes used as another synonym for Ostracize.
Ostracize means either to exclude, banish, shun, reject, exile, boycott, avoid, ignore, ban, excommunicate etc.
Eg. She was ostracized by her friends for her evil ways. (Here the usage of ostracized is to mean that she was shunned or avoided by her friends for her evil ways)
Expel means to officially and forcibly make someone leave something or a place. Sometimes it could mean to officially and forcibly either throw or oust or remove someone.
Eg. She was expelled from the country after her trial.
(Meaning: She was forcibly thrown out of or forced to leave the country, after her trial)