In The Hobbit movie series the door of the Lonely Mountain was closed and protected by a stone wall.
The dwarves break open the doors with a giant bell in the end but who built that wall and what was its purpose?
It was the movie's depiction of the Front Gate of Erebor. It was the only way in, aside from the secret door, that Smaug left open since it was big enough for him to pass through when he initially invaded the mountain. He broke and blocked all the other entrances.
So the original builders of the walls and gate were the dwarves of Erebor.
If you go by the books, the Thorin and his dwarves built a high and thick wall from squared stones that they broke by levering it outwards - no actual bell was used in the book. It just made a better scene for the movie to have one, I guess.