It is entirely legal as both of these species are not-native to the USA. The introduction of the Starling (Sturnus vulgaris) and the House Sparrow (Passer domesticus) into North America was followed by their subsequent rapid spread. Martins and other cavity nesters are forced to compete with these foreign species for nest sites. Purple Martins in particular have faced severe competition, because martins in the eastern United States now nest largely in man-made birdhouses which are usually erected in areas of human habitation. These habitats are also preferred by the House Sparrow and Starling. The House Sparrow originated in the Middle East and spread, along with agriculture, to most of Eurasia and parts of North Africa. The European Starling was purposefully introduced to North America in 1890-1891.
Ask any Martin landlord his/her opinions about these two species and be prepared to get an earful on what should be done about these pests.