JJ Spaun defeated Robert MacIntyre by two strokes to clinch the US Open title.