In 2015 New York State ranked 34th, and Massachusetts ranked 1st in 8th grade math scores according to Dept. of Educ. National Report Card*.
Perhaps, the key to Mass. being tops in education is a rich tradition of higher learning that pupils, parents, and teachers possess that starts with their state constitution****.
John Adams was the principal author of the Massachusetts Constitution . Voters approved the document on June 15, 1780. It became effective on October 25, 1780, and remains the oldest functioning written constitution in continuous effect in the world
The end of the institution, maintenance, and administration of government, is to secure the existence of the body politic, to protect it, and to furnish the individuals who compose it with the power of enjoying in safety and tranquility their natural rights, and the blessings of life: and whenever these great objects are not obtained, the people have a right to alter the government, and to take measures necessary for their safety, prosperity and happiness.
The body politic is formed by a voluntary association of individuals: it is a social compact, by which the whole people covenants with each citizen, and each citizen with the whole people, that all shall be governed by certain laws for the common good. It is the duty of the people, therefore, in framing a constitution of government, to provide for an equitable mode of making laws, as well as for an impartial interpretation, and a faithful execution of them; that every man may, at all times, find his security in them.
We, therefore, the people of Massachusetts, acknowledging, with grateful hearts, the goodness of the great Legislator of the universe, in affording us, in the course of His providence, an opportunity, deliberately and peaceably, without fraud, violence or surprise, of entering into an original, explicit, and solemn compact with each other; and of forming a new constitution of civil government, for ourselves and posterity; and devoutly imploring His direction in so interesting a design, do agree upon, ordain and establish the following Declaration of Rights, and Frame of Government, as the Constitution of the Commonwealth of Massachusetts.
Chapter V, Section II
The Encouragement of Literature, etc.
Wisdom, and knowledge, as well as virtue, diffused generally among the body of the people, being necessary for the preservation of their rights and liberties; and as these depend on spreading the opportunities and advantages of education in the various parts of the country, and among the different orders of the people, it shall be the duty of legislatures and magistrates, in all future periods of this commonwealth, to cherish the interests of literature and the sciences, and all seminaries of them; especially the university at Cambridge, public schools and grammar schools in the towns; to encourage private societies and public institutions, rewards and immunities, for the promotion of agriculture, arts, sciences, commerce, trades, manufactures, and a natural history of the country; to countenance and inculcate the principles of humanity and general benevolence, public and private charity, industry and frugality, honesty and punctuality in their dealings; sincerity, good humor, and all social affections, and generous sentiments among the people
* National Report Card:
** (source: https://www.nytimes.com/2015/11/22/us/rejecting-test-massachusetts-shifts-its-model.html )
***Mass. Dept. of Education K-12 Framework http://www.doe.mass.edu/frameworks/current.html
****Mass. Constitution: https://malegislature.gov/Laws/Constitution