Overall, Portraits and/or Ghosts would make for lousy professors. As seen below, their limited interaction with the living world would a severe hindrance in the teaching of any practical magic.
Portraits
JKR on Portraits, emphasis mine;
Hogwarts portraits are able to talk and move around from picture to picture. They behave like their subjects. However, the degree to which they can interact with the people looking at them depends not on the skill of the painter, but on the power of the witch or wizard painted.
When a magical portrait is taken, the witch or wizard artist will naturally use enchantments to ensure that the painting will be able to move in the usual way. The portrait will be able to use some of the subject’s favourite phrases and imitate their general demeanour. Thus, Sir Cadogan’s portrait is forever challenging people to a fight, falling off its horse and behaving in a fairly unbalanced way, which is how the subject appeared to the poor wizard who had to paint him, while the portrait of the Fat Lady continues to indulge her love of good food, drink and tip-top security long after her living model passed away.
However, neither of these portraits would be capable of having a particularly in-depth discussion about more complex aspects of their lives: they are literally and metaphorically two-dimensional. They are only representations of the living subjects as seen by the artist.
Some magical portraits are capable of considerably more interaction with the living world. Traditionally, a headmaster or headmistress is painted before their death. Once the portrait is completed, the headmaster or headmistress in question keeps it under lock and key, regularly visiting it in its cupboard (if so desired) to teach it to act and behave exactly like themselves, and imparting all kinds of useful memories and pieces of knowledge that may then be shared through the centuries with their successors in office.
The depth of knowledge and insight contained in some of the headmasters’ and headmistresses’ portraits is unknown to any but the incumbents of the office and the few students who have realised, over the centuries, that the portraits’ apparent sleepiness when visitors arrive in the office is not necessarily genuine.
So we can see that a portrait can only have limited interaction with the outside world unless a couple criteria are met 1) the wizard is very powerful, and 2) the portrait has been taught all the information from the subject of said portrait. So, to have a portrait that can teach classes, it must have been designed to do so from the start. You could not just take a portrait of a wizard who did well in a subject and have it teach.
Also from a practical aspect, a portrait will not be able to cast spells in the real world, making it difficult to demonstrate them and their effects. Classes like Charms, Transfiguration, and DADA are all heavy on spell casting and would need the nuance of live interaction.
Ghosts
JKR on Ghosts, emphasis mine;
In the world of Harry Potter, a ghost is the transparent, three-dimensional imprint of a deceased witch or wizard, which continues to exist in the mortal world. Muggles cannot come back as ghosts, and the wisest witches and wizards choose not to. It is those with 'unfinished business', whether in the form of fear, guilt, regrets or overt attachment to the material world who refuse to move on to the next dimension.
Having chosen a feeble simulacrum of mortal life, ghosts are limited in what they can experience. No physical pleasure remains to them, and their knowledge and outlook remains at the level it had attained during life, so that old resentments (for instance, at having an incompletely severed neck) continue to rankle after several centuries. For this reason, ghosts tend to be poor company, on the whole. They are especially disappointing on the one subject that fascinates most people: ghosts cannot return a very sensible answer on what it is like to die, because they have chosen an impoverished version of life instead.
The most productive ghost at Hogwarts is, of course, Professor Binns, the old History of Magic teacher who fell asleep in front of the staff-room fire one day and simply got up to give his next class, leaving his body behind. There is some debate as to whether or not Professor Binns realises he is dead. While his entrance to lessons through the blackboard is vaguely amusing the first time students see it, he is not the most stimulating teacher.
So again, there limitation placed on how a ghost can interact with the living. With there needing to be a reason for a ghost to stay behind, I doubt many would have "guilt, fear, or an overt attachment" to teaching. Professor Binns seems to be the exception to this, and it is sometimes question whether or not he knows he is dead...