Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) was asked about a man who wanted to have intercourse with his wife during the day in Ramadaan, and he broke his fast with food before having intercourse, then he had intercourse. Does he have to offer expiation or not? What about the one who breaks the fast with no excuse?
He replied: Praise be to Allaah. There are two well-known scholarly views concerning this matter. The first is that it is obligatory. This is the view of the majority, such as Maalik, Ahmad, Abu Haneefah and others. The second view is that it is not obligatory. This is the view of al-Shaafa’i… Then they disputed as to whether it is essential that he have broken a valid fast (in order for the severe expiation to be required). Al-Shaafa’i and others said that that is essential, for example if he eats and then has intercourse, or he starts the day intending not to fast and then has intercourse, or he has intercourse, then offers expiation, then has intercourse again.
He does not have to offer expiation, according to al-Shaafa’i, because he did not have intercourse during a valid fast. But Ahmad and others say that he does have to offer expiation in these and similar cases, because he should have refrained from eating etc during Ramadaan, so this is an invalid fast. This is like invalid ihraam. If a pilgrim who has entered ihraam for Hajj spoils his ihraam, he has to continue refraining from the things that are forbidden during ihraam, like those whose ihraam is still valid.
Similarly, if a person is obliged to fast during Ramadaan, he has to refrain even if his fast is spoiled by eating or having intercourse, or by not having the intention to fast. He should still refrain from doing the things that are forbidden when fasting. But if he does not refrain, he is still subject to the same requirement of expiation as if his fast was still valid. And in either case he has to make up the fast as well.
And Allaah knows best