Stocks fell for the third straight month in October as markets struggled with the combination of rising interest rates and war in the Middle East.