Clearly it was, but did no one bring a legal challenge against this at all?
Full text:
https://rclinton.files.wordpress.com/2007/11/code-of-indian-offenses.pdf
Native Americans were not even considered US citizens when this law was passed (a status granted by the federal government in 1924), which is perhaps the most direct answer to this question. Beyond that, remember, as ever, constitutionality is in the eye of the beholder. The Supreme Court, and the lower district courts, for that matter, had a very different view of equality and Constitutional protection than we do today. In the 1901 case Downes v. Bidwell, for example, the Supreme Court ruled that the "alien races" that inhabited America's overseas empire could not understand the "Anglo-Saxon principles" that underlay American law (here, I am, of course, cribbing from John Oliver). In 1854, Justice John Murray of the California Supreme Court ruled that equality under the American legal system "must, by every sound rule of construction, exclude everyone who is not of white blood."
So, as ever, your answer has a lot to do with racism and who the government officially considered to be an American.
It's important to realize that the idea of what counted as a religion is an evolving concept. As my teachers used emphasize as an undergraduate religious studies major, religion is a category that exists in the scholar's mind, not out in the world. Generally, it's not an indigenous category. Christians (or in some parts of the world, Muslims) would generally have to go around "explaining" that this is religion, this is culture, this is tradition, this is X, Y, or Z. And the boundaries of those things changed and were negotiated. A famous example is Chinese Rites controversy which was basically about whether Confucianism and its rites were a religion or a tradition.
The "free exercise of religion" in the U.S. is protected by the First Amendment (the "free exercise clause"; the "establishment clause" also deals with religion). To my knowledge, unlike many of the other amendments and clauses in the Bill of Rights, there wasn't an attempt to judicially define what "free exercise" meant until almost a century after it passed. The very first case was Reynolds v. United States in 1878, which was about Mormons and polygamy. But before that, there was no real attempt to determine what counted as "religion" according to the Constitution, or what counted as limits to its free exercise. The next important free exercise case also dealt with Mormon polygamy, the 1890 Late Corp. of the Church of Jesus Christ of Latter-Day Saints v. United States. Both found that the government absolutely had the right to regulate the practices of these groups and it didn't impinge about their right to free exercise. There was an earlier case, Commonwealth v. Kneeland (1838), which found that blasphemy laws were totally fine and Massachusetts could jail a pantheist preacher for blasphemy (this was also the last time anyone was jailed for blasphemy in the U.S.). I am not sure how much the arguments dealt with free exercise vs. establishment, though.
We tend to just think we all know what a religion is, and that al religions are and should be protected by the Constitution, but that idea wasn't really tested for almost two centuries. The earliest case before the Supreme Court I'm aware of where the free exercise clause is argued to protect the practice of a non-Christian-based religion is Gallagher v. Crown Kosher Super Market of Massachusetts, Inc. (1961) which found that Kosher supermarkets had to abide by state laws and be closed on Sundays (there had been earlier ones in district courts, like Kotohira Jinsha v. McGrath [1950], about a Shinto shrine; the Supreme Court case Torcaso v. Watkins [1961] also ruled in favor of an atheist). The first one where a non-Christian litigant won that I'm aware of is Cruz v. Beto (1972) which found that a Buddhist was unconstitutionally denied access to his prison's chapel. The first one dealing with Native American religion that I'm aware is Bowen v. Roy (1986) (against Native Americans not wanting social security numbers for their child), and the very famous Employment Division v. Smith (1990) (Native American government employees can be fired for using peyote even as a religious sacrament--this inspired a lot of states and the Federal Government to write "Religious Freedom Restoration" Acts). The first one that I'm aware of a native/traditionalist style group actually winning before the Supreme Court is Church of Lukumi Babalu Aye v. City of Hialeah (1993) (non-traditional religion is protected and municipalities can't make laws targeting one), though Dettmer v. Landon (1986) had already ruled that Wicca counts as a religion (though it was licit for prisons to deny Wiccans ritual knives).
Which is all to say, the idea that non-Christian religions were protected was certainly there, but I think it would be wrong to think it was universal, and it certainly wasn't established in legal precedent for almost a certain after that code. The definition of what counted as "religion" we think of as natural, but it's an evolving idea. The best simple introduction to this is J. Z. Smith's chapter "Religion, Religions, Religious" (pdf). Many at the time certainly wouldn't believe that acts defined in the code were "paganism" or "Indian savagery" and not really religion. Notice that in the language of official act, words like "religion" and "religious" are not used at all. Instead, it's all about "civilization". And even if they were to recognize that what the Native Americans did really did count as a religion, the state would argue, just like in the recently decide case about Latter-day Saint plural marriage, that they had a compelling and legitimate interest in regulating these acts and that, therefore, the free exercise clause did not apply (notice that rule 5 bans plural marriage). I didn't read through all of them, I just glanced at them, but even if these were deemed "religious practices", it seems like all of them would similar fit under the government's interest in regulate social and moral behavior, as in the recently decided Reynolds v. United States case.