Deep, wide, near-infrared imaging surveys provide an opportunity to study the clustering of various galaxy populations at high redshift on the largest physical scales. We have selected 1 < z < 2 extremely red objects (EROs) and 1 < z < 3 distant red galaxies (DRGs) in SA22 from the near-infrared photometric data of the UKIDSS Deep eXtragalactic Survey and gri optical data from the Cerro Tololo Inter-American Observatory covering 3.3 deg2. This is the largest contiguous area studied to sufficient depth to select these distant galaxies to date. The angular two-point correlation functions and the real-space correlation lengths of each population are measured and show that both populations are strongly clustered and that the clustering cannot be parametrized with a single power law. The correlation function of EROs shows a double power law with the inflection at ∼0.6–1.2 arcmin (0.6–1.2 h−1 Mpc). The bright EROs (K < 18.8) show stronger clustering on small scales but similar clustering on larger scales, whereas redder EROs show stronger clustering on all scales. Clustering differences between EROs that are old passively evolved galaxies and dusty star-forming galaxies, on the basis of their J −K colour, are also investigated. The clustering of r −K EROs is compared with that of i −K EROs and the differences are consistent with their expected redshift distributions. The correlation function of DRGs is also well described by a double power law and consistent with previous studies once the effects of the broader redshift distribution our selection of DRGs returns are taken into account. We also perform the same analysis on smaller subfields to investigate the impact of cosmic variance on the derived clustering properties. Presently, this study is the most representative measurement of the clustering of massive galaxies at z > 1 on large scales.