They didn't disobey God, as they weren't commanded to sell their possessions; what they did do was lie to the Holy Spirit:
Then Peter said, Ananias, how is it that Satan has so filled your heart that you have lied to the Holy Spirit and have kept for yourself some of the money you received for the land? Didnt it belong to you before it was sold? And after it was sold, wasnt the money at your disposal? What made you think of doing such a thing? You have not lied just to human beings but to God.
As you can see, the man had full control of the property and the monies from selling it. The problem wasn't therefore a failure to obey, for if it was these would not be admitted; it was because they were posturing as though the monies given were the full price of the property... I suspect that Ananias could have been utterly truthful and still divided the money (Paul says that those who do not provide for their families are worse than unbelievers, keeping a portion for his wife after his death could be just such a provision).