“And how can it behave like a wave and pass through a vacuum, when all other waves require a medium to propagate?”
Wrong! Electromagnetic waves do not require a medium through which to propagate. Radio, television, x-ray, light are different frequencies of electromagnetic fields which travel through a vacuum at 299,792,458 meters per second.
“when all other waves “
...referring to mechanical waves e.g, sound, water, earthquake.