If you look carefully, you will find that there is actually no ghost, human nature is scarier than ghosts. Human nature is nothing but two, sex and violence.
The ghost inside is Aaron, who I suspect is schizophrenic, and he kills everyone. The ghost in there is actually the evil within Aaron. In the end the movie uses the male character being possessed again to expose human nature.
In a group, there are always radicals, conservatives, and people to laugh at. The radicals bring out the humanity and the violence by playing and laughing at others for fun.
The conservative ones are actually more evil and hide their humanity, and most of us are like that. Neither helping the mocked nor stopping the radicalized, they are cold-blooded and often have a sneaky nature to make fun of others. In the end, when Aaron is killed by the hero (conservative), you can realize that conservative people hide deep and scary.
The ending is possessed by the hero, lightly kissing the heroine, showing the human nature of sex, violence. I am also my own understanding, I do not know if it is right
Maybe the movie is illogical, but this movie is to expose human nature, you know what human nature is a thing on the line.
Also, I feel that the people who are played and mocked, the demented, the stupid, are often the closest to God, they are good by nature, but they are made fun of by the world.
Our humanity is moving further and further away from God and closer to Satan. So we have faith to purify our hearts.