As various commenters have noted above, the choices of whether to capitalize or lowercase rpm/RPM and whether to close up or include a letter space between the number and the unit of measure are style issues to be determined by style guide, house style rules, or (in a vacuum) lonely authors.
Nevertheless some trends are discernible in historical published instances of three similar abbreviations of rates: miles per hour (mph/MPH), revolutions per minute (rpm/RPM) and frames per second (fps/FPS).
Starting with "miles per hour," I ran test for four forms: "60 mph" (blue line), "60mph" (red line), "60 MPH" (green line), and "60MPH" (yellow line) for the period 1900–3005. This chart shows the case-sensitive results:

Ngram shows the case-insensitive results (which reduce the four lines to two—with and without the letter space) for the same data here: Ngram graph
For "revolutions per minute," here is the corresponding case-sensitive chart for "45 rpm" (blue line), "45rpm" (red line), "45 RPM" (green line), and "45RPM" (yellow line) for the same period:

and the case-insensitive graph: Ngram graph
And finally for "frames per second," here is the case-sensitive chart for "30 fps" (blue line), "30fps" (red line), "30 FPS" (green line), and "30FPS" (no line—too few results) for the same period:

and then case-insensitive graph: Ngram graph
These charts show a consistent preference in published works for lowercase over all-caps treatment, and for open over closed presentation. But they also show that there has never been unanimity with regard to the proper treatment of such expressions.
I should note that Ngram reads and reports hyphenated forms (60-mph, 45-rpm, and 30-fps, for example) as open forms (60 mph, 45 rpm, an 30 fps)—but that doesn't skew the results in this case because the hyphenated forms occur primarily when the open form of the noun is being put to work as an adjective.