The main purpose of this legislation, known as the Grant Integrity and Border Security Act, is to ensure that organizations applying for federal grants are not violating immigration laws, specifically those related to the illegal bringing in and harboring of aliens. The legislation aims to enhance accountability and integrity in the use of federal funds by linking grant eligibility to compliance with immigration regulations.