The sea is the cemetery of the Chateau D’If because that is where the bodies of dead prisoners are sent. Faria does not go in, because Dantes switches places with him when the guards aren't looking.
When Faria dies, his body is to be put into the ocean. Since the Chateau D’If is an isolated prison right next to the sea, it is a logical place to put bodies. The prison officials can just weigh the bodies down after wrapping them in canvas and toss them in, much as ships at sea do. There is no digging required.
On the bed, at full length, and faintly illuminated by the pale light that came from the window, lay a sack of canvas, and under its rude folds was stretched a long and stiffened form; it was Faria's last winding-sheet, -- a winding-sheet which, as the turnkey said, cost so little. (Ch. 20)
Dantes is so miserable when Faria dies that he is thinking about committing suicide himself. However, the thought of not outliving the people who wronged him is too much for him. He feels that he has suffered too much to die so soon. Then he gets an idea.
Since none but the dead pass freely from this dungeon, let me take the place of the dead!" ... [He] bent over the appalling shroud, opened it with the knife which Faria had made, drew the corpse from the sack, and bore it along the tunnel to his own chamber… (Ch. 20)
Dantes changes places with Faria in order to escape from the prison. He knows that once he is buried and escapes, he can swim to safety, and by the time the prison guards find out what happened he will be long gone. Dantes does not realize that the body is not going to be buried. It is thrown into the ocean. Dantes is shocked, but has the “sufficient presence of mind to hold his breath” (Ch. 21). He dives so they will not see him swimming if they look down. He then fears that he might get a cramp and sink. Fortunately for Dantes, he is able to find a boat and start the next part of his plan.
The escape from prison did not go exactly as planned, but worked nonetheless. There was no way Dantes could know that the sea was the cemetery of his prison. He just knew that he had to get out. Grieving from Faria’s death, Dantes is still determined to make the people who wronged him pay. Escaping with knowledge of Faria’s treasure is the first step. Chances are, Faria was buried at sea as soon as his body was found.