The purpose of the Civil Rights Act of 1964 was to end segregation and discrimination based on race, color, religion, sex, or national origin in public facilities and federally funded programs. It aimed to protect the civil rights of all individuals and ensure equal treatment under the law.