He was fully aware of both the plans of the Uchiha and Konoha. He didn't just do it. He knew that the coup was coming.
Of course he lied to his brother. And everyone else thought tobi was madara. that had seen him that is (Nagato, Konan, Kisame). Tobi is a liar too so we can't just take...