Commander Robert Fancy and Commander Ian McGhie both pleaded guilty at the hearing at Portsmouth naval base to a charge of negligence causing the grounding of the nuclear-powered submarine HMS Trafalgar close to Skye on 6 November, 2002.
Damage to the vessel was estimated at 5 million.
Cdr Fancy was sentenced to a severe reprimand while Cdr McGhie was given a reprimand by the court martial panel.
The naval prosecutor, Lieutenant Commander Alison Towler, described how the submarine, at a depth of 50 metres and travelling at 14.7 knots, ploughed into the seabed of a small island called Fladda-Chuain as the submarine changed direction, injuring three sailors and causing the entire crew to fall over.
She told the hearing that Cdr Fancy had responsibility during the Perisher submarine command course for the navigation while Cdr McGhie, known as "teacher", had overall command of the training course.
The actual navigation was being carried out by Lieutenant Commander Tim Green, who was training to become the commander.
The court martial heard that during the training session the two commanders, both aged 39, agreed to make the task more difficult for Lt Cdr Green. They did this by removing some of the navigational aids as well as forcing the submarine to go deeper underwater.
Lt Cdr Towler said: "Having denied the student the use of the ship’s inertial navigation system (SINS), and the ship’s navigation and positioning system (SNAPS) and global positioning system (GPS), both Cdr Fancy and Cdr McGhie had a responsibility to ensure the submarine’s position. Neither did so.
"At the time when the submarine became most vulnerable, deep-dived and without the use of navigational aids, Cdr Fancy became distracted from concentrating on the navigation of the submarine. He was concentrating on ship control rather than checking that the submarine’s navigation was being properly conducted. His main focus should have been on navigation but it appears not to have been."
Lt Cdr Towler said: "Lt Cdr Green was struggling on the Perisher course. He was under considerable pressure and probably wished to impress. However, his chart work was untidy. His poor chart work alone should have put Cdr Fancy on notice that all was not well, encouraging him to pay more attention to the navigational aspects."
Cdr Stephen Taylor, defending Cdr Fancy, described him as "an exceptionally able and diligent commanding officer" whose priority was always the safety of his ship.
He said: "Cdr Fancy fully accepts, as he has done right from the start, that he made certain errors and these errors meant his submarine was endangered."
Cdr Hugh Anderson, defending Cdr McGhie, said that he was removed from his post as commanding officer of the training course and now works for the Ministry of Defence in London.
He said that Cdr McGhie accepted his part for the responsibility in causing the accident to happen.
Lt Cdr Towler said it was decided that Lt Cdr Green should not be disciplined by courts martial for his part in the accident but instead by administrative censure.
The court martial was told that new safety procedures had been put in place for the training sessions as a result of this accident.