This is a question with no one right answer. I strongly prefer deck stepped masts if they are properly engineered but more on that later.
Keel stepped masts
better for big boats)
Advantages- It is easier to get proper support for a keel stepped mast right at the hull. In theory there are less side loads introduced into the deck and so is less likely to damage deck over time. Also if the rig is lost or damaged there is likely to be a bigger piece of rig left for a jury rig. On a racing boat it is easier to introduce pre-bend. Mast electrical connections occur below decks.
Disadvantages- If the mast has internal halyards (which I strongly recommend) then you always have water in your bilges. If the mast is not mechanically tied to the deck and keel, you stand a chance of springing the hull and bulkheads as the mast pushes down on the keel and the shrouds pull up and in on the hull. If you do loose a mast due you are more likely to sustain major deck damage. It is much harder to cut away a keel stepped mast and so the boat is more likely to be holed by its own rig. You have a big piece of aluminum passing through your cabin that you need to leave room around.
Deck stepped mast: (better all around)
Advantages: Easier to step and unstep. Simplier to tune. Does not bring water down below. Mast step and mast end is not in bilge and so less prone to electroysis damage.
Disadvantages: Harder to engineer. (see my opinion below). Electrical connections exposed to weather or concealed under mast. More likely to loose whole mast and hardware if mast is lost over the side.
IMHO masts should be deck stepped with the mast step over aluminum jack pole (king post) that has a welded top plate that can be through bolted through the deck into a moment connected bottom plate on the mast. This gives all of the advantages of both keel and deck stepped rigs.