Why were Dumbledore and Ron so angry with Harry when his name appeared in the Goblet of Fire? These two people had never questioned him before so why did they suddenly become enraged at him?
I don't remember what happen in the movie but in the book Dumbledore was calm.
“Did you put your name into the Goblet of Fire, Harry?” he asked calmly.
“No,” said Harry. He was very aware of everybody watching him closely. Snape made a soft noise of impatient disbelief in the shadows.
“Did you ask an older student to put it into the Goblet of Fire for you?” said Professor Dumbledore, ignoring Snape.
“No,” said Harry vehemently.
Harry Potter and the Goblet of Fire, Chapter 17, The Four Champions
I think Hermione explains Ron's reaction very well, when she says
“Oh Harry, isn’t it obvious?” Hermione said despairingly. “He’s jealous!”
“Jealous?” Harry said incredulously. “Jealous of what? He wants to make a prat of himself in front of the whole school, does he?”
“Look,” said Hermione patiently, “it’s always you who gets all the attention, you know it is. I know it’s not your fault,” she added quickly, seeing Harry open his mouth furiously. “I know you don’t ask for it... but - well - you know, Ron’s got all those brothers to compete against at home, and you’re his best friend, and you’re really famous - he’s always shunted to one side whenever people see you, and he puts up with it, and he never mentions it, but I suppose this is just one time too many...
Harry Potter and the Goblet of Fire, Chapter 18, The Weighing of the Wands
There are other reasons, because this was the first time Ron wasn't involved in Harry's adventure.
1. Harry Potter and the Sorcerer's Stone: Ron won 50 points for Gryffindor
“First — to Mr. Ronald Weasley...”
Ron went purple in the face; he looked like a radish with a bad sunburn.
“... for the best-played game of chess Hogwarts has seen in many years, I award Gryffindor house fifty points.”
Harry Potter and the Sorcerer's Stone, Chapter 17, The Man With Two Faces
2. Harry Potter and the Chamber of Secrets: Ron won Special Awards and 200 points for Gryffindor
“You will both receive Special Awards for Services to the School and — let me see — yes, I think two hundred points apiece for Gryffindor.”
Harry Potter and the Chamber of Secrets, Chapter 18, Dobby’s Reward
3. Harry Potter and the Prisoner of Azkaban: Managed to beat the Ministry of Magic and Saved Sirius Black
Now look at it from Ron's perspective, his best friend found a way to become second champion of Hogwarts but Harry did not help him become a champion nor did Harry bother informing him. As a friend who stood by Harry to fight Voldemort, Lupin (when he was werewolf) and the Dementors, Ron naturally felt let down by Harry.
Ron is one of many siblings, so he was probably often overlooked. He saw the Tournament as a chance at glory, and was so angry at Harry for (apparently) finding a way around Dumbledore's spell and not sharing it with his best friend. He actually says this second part when the two make peace. As for Dumbledore, I think rather than anger, Dumbledore's attitude was out of worry and alarm and a little anger that maybe Harry DID put his own name in the cup somehow. I say 'I think' but Dumbledore's love for Harry and concern for him throughout the series supports my reasoning. Dumbledore knew what the Tournament is like and - like a parent - was deeply concerned for Harry going through it, and that he'd possibly fallen prey to a devious act (someone putting his name in the cup with ill intent), plus what he would face in the coming years: Voldemort and the Horcruxes (Albus already knew or suspected all this, as explained in Half-Blood Prince).
Ah... it's funny how much the movies change that scene. Dumbledore was calm the entire time in the books; he simply calmly asks Harry the obvious questions to convince Karkaroff and the other non-believers. Also, he wasn't angry with him in the slightest.
As for Ron? Ron was probably feeling left out and his insecurities over being "overshadowed" got the worse of him and he thought Harry had somehow put his name into the goblet without telling him. Hermione was not completely right about him being jealous either, because Ron has had plenty such instances and he's only usually been happy for Harry. While the movies were mostly right about Ron's reaction, they were so hilariously wrong about Dumbledore's the scene actually made me laugh. Because the entire time, Dumbledore was practically in Harry's face interrogating him, when he was supposed to be calm.
Dumbledore was angry because the script-writers decided to change book canon into an absurd out-of-character outburst by movie-Dumbledore.
Ron was angry because he believed Harry had gone behind his back to put his name in the Goblet. He felt Harry should have told him and taken him along so he could have put his name in too. Ron was upset that it was always Harry in the spotlight, never him.
The reason they are angry is because Ron is poor and sees Harry as his support because he is a middle child. I mean Ron is a middle child so forcing his friendship on Harry he can be seen as a strong support of TBHL (The Boy Who Lived) not just a moral friend.
Dumbledore likely planned it happening or had some foreknowledge as he usually keeps things a lot from Harry in order to test his growth as Harry is a weapon to Dumbledore so Dumbledore shows no favoritism. Dumbledore has a bad history of refusing to believe he can make wrong decisions and it has cost him his staff and students whom are close to him.