The federal government has apologised to Australian Defence Force personnel kicked out and prevented from serving on the basis of their sexuality.