From the IMDb:
'THE ANDY GRIFFITH SHOW'
"A NEW DOCTOR IN TOWN"
Mayberry has a new doctor in town who runs into difficulty being accepted because no one wants to be his first patient.
When Andy first walks into [Doctor Petersen's office], you can see a production man in the right side of the screen, in a blue short sleeve shirt.
We just dealt with this kind of situation in an episode of 'Columbo', and we're going to use the same splainin for what happened here in the TV Universe....
That man in the blue shirt? Certainly NOT a production man, or even a moving man who's delivered the last few boxes for Dr. Thomas Peterson. If he was, the Doctor and Andy would have given some acknowledgement that he was there.
But they don't see him. And by now you've figured out why....
Yep. He's a ghost.
Like the circumstances of most ghosts, his uneasy spirit is tied to that office because that's where he died. I figure he must have been a patient of the previous occupant, Dr. Bennett.
Dr. Bennett had been the GP in Mayberry since at least 1926. But he suddenly decided to retire. Sure, he was old; here's how he looked like in his only appearance on the show:
But why did he make such an abrupt decision?
I think it's because he deliberately killed that guy in the blue shirt.
Dr. Bennett may have been practicing medicine in Mayberry for forty years, but that murder had to have happened just before he retired in 1966. That's because the ghost's clothing was contemporary to that episode.
The man in the blue shirt may have visited Dr. Bennett for some kind of ailment, perhaps unannounced and late at night. It may have been something that was non-life threatening, but for some reason, Dr. Bennett felt compelled to violate the Hippocratic Oath and end the man's life rather than treat him.
So here's the next big question: why would old Doctor Bennett kill the man in the blue shirt?
Whoever he was in Mayberry, the man in the blue shirt posed a major threat to either the physician's reputation, his family, his livelihood, or even to his very life.
It would have been easy enough for the doctor to assess the threat and come up with a deadly solution to remove that threat. Dr. Bennett would have convinced the man in the blue shirt that he had the flu. (As all of this happened off-screen, free of the constraints needed to maintain the wholesome image of on-screen Mayberry, perhaps Doc "diagnosed" him as having an STD.)
And then? A quick jab with a needle filled with "the cure", but it was a cure more beneficial to Doc Bennett than to the man in the blue shirt. (Shades of that 'Twilight Zone' episode "What You Need".)
As for the disposal of his victim's body, I don't consider that a big question. This is why I think the visit to Dr. Bennett had to be at night. Old though he was, Dr. Bennett was still strong enough to hoist that dead weight ('Columbo' reference!) and put it into the car belonging to the man in the blue shirt.
From there, he had plenty of options:
1} Dump the body into Myers Lake and make it look like a fishing mishap - most Mayberrians always have their fishing poles handy, so the victim probably had one in the car.
2} Leave it in the front seat of the car and push it over the edge of Lover's Leap.
3} Leave him not far from where Rafe Hollister's moonshine still was rumored to be and splash the body with grain alcohol so it might be assumed he drank himself to death.
No matter how he staged it, Dr. Bennett knew that Sheriff Andy Taylor would most likely consult with him as an ad hoc coroner to determine the cause of death.
But wherever his body was dumped, the ghost of the man in the blue shirt would have returned to the scene of the crime. And that may have spurred Dr. Bennett to flee Mayberry, more than the fear of getting caught.
And even though he couldn't see the man in the blue shirt, Dr. Thomas Petersen might also have felt the ghost's presence in his office. That could be why Dr. Petersen was not in Mayberry for very long. (He was gone two years later when Doc Roberts was the town physician.)
All just supposition on my part, but it's as good a splainin as any for that man in the blue shirt whom Andy couldn't see....
Originally, this was going to be a theory of relateeveety establishing Dr. Thomas Petersen as the nephew of Father Francis Mulcahy (of 'M*A*S*H'). But that can wait. It's October! Always best for a ghost story!