This randomized pilot trial studies vaccine therapy and pembrolizumab in treating patients with prostate cancer that does not respond to treatment with hormones (hormone-resistant) and has spread to other places in the body (metastatic). Vaccines made from deoxyribonucleic acid (DNA), such as pTVG-HP plasmid DNA vaccine, may help the body build an effective immune response to kill tumor cells. Monoclonal antibodies, such as pembrolizumab, may find tumor cells and help kill them. Giving pTVG-HP plasmid DNA vaccine and pembrolizumab may kill more tumor cells.