Exactly. I haven't done the math, but I'm pretty sure solar panels are cheaper than roofing (decking and up) per surface area.But if one actually wants a pergola, then there is no real extra cost.
FWIW, I picked up two 10x10 metal frame pergolas from At Home for $250 each when they had a big sale. At some point, panels will be going on them. I also drove 8ft T-posts into the ground and then dropped the frame studs over them. It's not going anywhere.
The wife and I wanted a nice covered outdoor area, so I killed two birds with one stone.