Once validly received, sacred ordination never becomes invalid. A cleric, nevertheless, loses the clerical state: 1/ by a judicial sentence or administrative decree, which declares the invalidity of sacred ordination; 2/ by a penalty of dismissal legitimately imposed; 3/ by rescript of the Apostolic See which grants it to deacons only for grave causes and to presbyters only for most grave causes.
Source: Code of Canon Law (Vatican.va)