Is a PhD on a relevant subject as valuable as spending the same time gaining work experience in the same field?

This depends. How easily can you get relevant experience in your PhD vs in the workplace? PhD research typically is centered on deep investigation of a specific niche, and depending on where you are, that may be more easily accomplished in either scenario. More relevant to your question is what do you want to do