I'm a little into Buddhism and it's history, so I have a vague concept that in the late 19th century the Japanese government reformed Buddhism and Shintoism to allow for things like monks to get married, made it so that the head monk of a monastery was a hereditary position, etc.
Why is this? What were the aims of the government in trying to change Japanese religious institutions like this?
Well, hopefully an expert can come in and relate to you the specific question about reforming things like marriage etc. I know the general situation and development, but not something as specific as why they'd think clerical celibacy was bad.
In general, the Meji government was trying to become a western-style industrialised nation state.
It's rarely known, but in Japan temples actually ended up in a very similar position as the Catholic church had in Europe. Wealthy people would donate land to the temples, who would keep it in perpetuity and could eventually control like a third of the land in a province (I won't venture to guess what the peak total might've been across Japan, but it was a significant amount).
The Meji government wanted to centralise according to the European model, which meant disowning these temples like the Catholic church had been all across Europe.
Meanwhile, part of becoming a nation state is the formation a single cultural-ethnic population. That is, one people, one culture, and thus one religion. And the Meji government wanted a 'pure' Japanese religion for the new Japanese nation state.
Shinto became that religion, but it would be erroneous to copy the claim that Shinto is the 'original' religion of Japan. Even if you might still find people saying so, it is not academically viable. Whatever religion existed in Japan before the introduction of Buddhism in the 6th century has been lost to time. The 'Shinto' that existed was a branch of Japanese Buddhism which had incorporated syncretic elements from those now lost original traditions. But under influence from this desire for national 'purity' it was separated and elevated into its own, now national, religion. (Though to be exact, the nationalistic movement to separate Shinto from Buddhism had already started some centuries before the Meji government institutionalised it.)