That really depends on what kind of obstacles it is you have to go through. I really liked the third generation gyms, because they managed to include obstacles, while still keeping it simple and fun. The third generation Flying type gym was probably one of my favourites to go through, mainly because I felt like it was a fun puzzle, but it was neither hard, nor was it really boring to go through. But then again, the third generation gyms are just borderline, since apart from a few, they don't really take much thinking to get through. They definitely improved on the previous generation gyms though, since for example the Electric type gym in the first generation, which was just about the only gym where there was any kind of puzzle, was really quite annoying. There was no specific pattern to the whole thing from what I remember, except that the second switch was just close to the first one, which just meant a lot of wasted time on something that wasn't fun, and that's definitely been improved in the later generations.
While some puzzles are fun and really adds to the experience while going through gyms, there are some where I'd really just prefer being able to go right on through, and facing the trainers untill I eventually get to battle the gym leader. Yeah, it's boring, but some puzzles can get really tedious and annoying, to a point where it just isn't fun, and that's a really bad way of presenting the gyms, where as gyms where it's just straight forward don't give me any reason to really like or dislike it, except for the trainers we get to face, but that's unrelated, and I just find that a whole lot better than potentially ruining a gym with annoying puzzles that are just there to make the gyms longer rather than make them fun.
So in short, I don't prefer any of the two, but rather the gyms and the puzzles individually. I can't say I prefer gyms with any kind of obstacles, since there some that I don't like, and I can't say I prefer the ones without, since there are also some with obstacles that I do like.