The origin of yuri comes from Class S novels.
This genre was created 100 years ago.
In this time, the main readers of Class S novels were girls.
In 70s, the word yuri is created by the editor of Barazoku (rose tribe, the magazine for gays). But Yuri still targets girl or lesbians.
In 90s to 00s, these yuri novels/manga were found by fanboys.
Ex. Sailor Moon, Revolutionary Girl Utena and Maria-sama ga Miteru.
These novels/manga were targeted for girls, but got interest from fanboys also.
In 00s, many yuri manga/anime were created for fanboys, like Kannazuki no Miko, Kashimashi and others.
Currently, yuri for boys has bigger market than yuri for girls.
Wikipedia's history of yuri section has more details.
Added: I forgot to mention about Yuri Danshi (The yuri man).
Hanadera is a high school boy who loves yuri to the point he
constantly watches his female classmates and just lets his imagination
run wild. He's living the fabulous life of a man obsessed with yuri,
but this is also source of personal conflict: if a yuri-filled world
is so perfect, where does he fit in as a man?
Yuri Danshi is meta fiction story about a man who likes yuri.
One of the chapters is about a yuri-only conference.
(Sorry I didn't remember the chapter number.)
The protagonist is planning to visit the yuri conference, but he is afraid that he will be the only male visitor of that conference. But finally he found most visitors were male.