Why did Willy get demoted from his job?
Willy is not demoted; he is fired. It is clear from the start of the scene with Howard, that Howard is not at all interested in the exhausted and distraught man in his office. Indeed, he is more involved with his tape recorder than with a human being.
Howard is the son of Willy's first boss, now dead, who hired Willy long ago. Willy tries to tell Howard promises Howard's father made to him many years before Howard was born, but Howard doesn't care. As said so well above, this is a modern world of selling, and the bottom line is all. You pull your weight or you're out. It seems that Howard has only been keeping Willy on for old times sake anyway. When Willy loses it on Howard and starts to yell at him, Howard takes that as his cue, his opporunity to unload Willy, a man who Howard sees as a drag on the business and an embarassment:
HOWARD Look, Willy...
WILLY (pressing his hands to his eyes): I gotta get myself some coffee. I’ll get some coffee... (Willy starts to walk out. Howard stops him.)
HOWARD Willy, look...
WILLY: I’ll go to Boston.
HOWARD: Willy, you can’t go to Boston for us.
WILLY: Why can’t I go?
HOWARD: I don’t want you to represent us. I’ve been meaning to tell you for a long time now.
WILLY: Howard, are you firing me?
HOWARD: I think you need a good long rest, Willy.
It's not just that Willy isn't making the money he needs to make (and he hasn't for many years), nor that he's cracked up his car; Howard doesn't want to Willy to represent the company any longer. He fires Willy there and then.
This scene sets in motion a cascading series of events that will, by the end of the evening, lead to Willy's suicide.
I think that there are two reasons. One is simply that he can no longer do the work that a saleman needs to do. He has memories of being a "great" salesman, but the play casts doubt on whether this was ever true. What is clear is that Willy did make enough money to raise a family and pay off the mortgage on his house ... or just about.
The other reason, which may be more of an explanation than a reason, is that the world has passed Willy by, and he hasn't noticed. His belief in the "cult" of personality, of being "well-liked", in promises that were made to him in a time where business was done on a handshake, and which, perhaps, never envisioned a Willy who could no longer "cut it" ---all this was gone (as was his "garden" in the yard dominated by the new houses, symbols of the new world. In this new world, you produce or you go.
And I think that Willy didn't get demoted; he got fired. He would have (or so he says) taken a "New York" job, but that offer was never made.
Willy Lowman in the play "Death of a Salesman" has been performing poorly for sometime. His job performance and reduction in sales have resulted in a smaller route that does not allow him to support his family.
Even with the smaller route, Willy is unable to make any money and has to borrow money from the head of the company. When Willy shows up at the office mouthy and verbally defiant he loses his position. He had been offered the position in Alaska but he knows that is just a way for the company to let him go.
Willy has been deteriorating mentally for sometime. It has been obvious to the staff around him when he reports in weekly but not to Willy. Willy still has dreams of rising above his circumstances.