Miller arrived at the Spanish track on the back of two DNFs, having crashed out in France and again in Italy.
Starting the race 23rd on the grid, the LCR Honda rookie made a flying start to run P15 by the end of the first lap.
From there he slowly made progress and was 10th on the penultimate lap before losing out in a late battle with Alvaro Bautista.
"I am really happy to bring the bike home after two races of not finishing," Miller said. "We struggled over the weekend and really had to work hard during the race.
"We got a good start, and we were in among a good group. I really got stuck in and settled into a rhythm, although I did have a few moments because it was slippery out there. We struggled a lot with the front still.
"It's good to put some more points on the board, but we are still learning all the time on the bike. I still need more laps on it and crashing out of the race is not the way forward."
The Aussie is now 18th in the Championship on 11 points.