A beam like that does not just rot out for no reason. There's been water getting in there for a while.
My guesss would be wrong flashing, or at least done wrong where the roof meets the siding, no starter strip under the first row of shingles, someone messed up and did not install drip cap when they installed the roof, not enough over hang on the lower edge of the shingles and the waters getting in behind the coil stock.
To change out that beam your looking at removing the siding, removing that outside corner, removing the porch ceiling, removing the siding and shingles on the roof to check the flashing at least.
Every time I see one of these it's the same old story, first thing I see is about 3 tubes of caulking where the home owner or some hack tryed to just patch it up. There should be no caulking needed if it was done right the first time.