Why can't armrests be raised on window and aisle seats?
Apparently, it can be done, atleast in some aircraft; even in those cases, the armrests are locked, unless one knows the location of the release button.

As for why, it seems that there is a possibility that the upright armrests can be an obstacle (for people in the next seat row) and FAA expects the cabin crew to ensure that the armrests are in forward condition prior to takeoff/landing. According to FAA Volume 3, Chapter 33, Section 3 Instrument and Equipment Requirements,


  Inspection of the Hardman Model 9500 and other passenger seats installed on several aircraft, disclosed that the armrest in the upright or stowed position can protrude approximately 45 degrees aft the seat back. In the event of an emergency evacuation, protruding armrests could present an obstacle between seat passageways, obstructing emergency exit access. Air Carriers should emphasize to F/As that prior to takeoff and landing they verify that the armrests are in the normal forward/down position in order to ensure that they do not obstruct the passageway between the row of seats leading from the aisle to the emergency exit.


As this is a problem in aisle seats (armrests in middle seats cannot go back usually), they have to be fixed forward or atleast locked in position. This is the reason for them to be locked in case of aisle seats. As for window seats, the sets are usually made in a row and you don't really know if the seat will end up in window or aisle i.e. whether the row will get fixed on left or right (or middle, in widebodies). Net result is that both the ends of the row are fixed just to be sure. In other words, the windows armrest is a collateral damage.