He is Speaker because he majority of Republican Congresscritters voted for him. They voted for him because they agree with him. Simple.
They did not vote for Ryan “because they agree with him” imo. The various House Republican “tribes” aka caucuses settled on Ryan as the least worst choice, as their preferred candidates couldn’t win a simple majority vote.