Al-Bukhaari (5191) and Muslim (1026) narrated from Abu Hurayrah (may Allaah be pleased with him) that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “It is not permissible for a woman to fast when her husband is present except with his permission.”
The version narrated by Abu Dawood (4258) and al-Tirmidhi (782) says: “No woman should fast when her husband is present except with his permission, apart from Ramadaan.” Classed as saheeh by al-Albaani in Saheeh al-Tirmidhi.
Al-Haafiz said: i.e., when he is present and is not traveling.
“Except with his permission” means apart from fasting the days of Ramadaan, and obligatory days apart from Ramadaan if there is not much time. This hadeeth indicates that it is haraam for her to observe the fast mentioned in the question without her husband’s permission. This is the view of the majority of scholars.
This hadeeth indicates that the husband’s right over his wife takes precedence over her doing voluntary good deeds, because his right is an obligation and doing what is obligatory takes precedence over doing a voluntary action.
This is to be understood as referring to voluntary and recommended fasts that are not to be done at a specific time. This prohibition was stated by our companions. The reason for that is that the husband has the right to be intimate with her on all days, and his right must be fulfilled immediately and cannot be delayed by a voluntary action or an obligatory action that could be done later on. If it is said that he should let her fast without his permission, and if he wants to be intimate with her he can do so and break her fast, the answer is that if she fasts, that usually prevents him from being intimate with her, because he would not want to spoil her fast.
With regard to the questioner saying, “even though that is an act of worship, and there is no obedience to any created being if it involves disobedience towards the Creator” –
We say: Yes, but if a woman does not observe a voluntary fast, that is not an act of disobedience or sin, rather what is sinful is not fasting in Ramadaan. Hence a woman should fast Ramadaan without her husband’s permission, as is indicated by the wording of the hadeeth narrated by Abu Dawood and al-Tirmidhi, quoted above.
The husband’s rights take precedence over observing a naafil fast because this is something that is obligatory, and when there is a conflict regarding acts of worship, that which is more important takes precedence.
And Allaah knows best.