I have ranked my networks from top to bottom in the Preferred Networks list in Network Preferences, but when my Mac boots it picks the wrong (lower-ranked) network. How can I make sure one network is preferred over others? Incidentally, the SSID of the network I want starts with "s" while the SSID of the network that I want second starts with "w," so the alpha order is right too.
Make sure the network you want is not a hidden (a.k.a. "closed", "non-broadcast SSID") network. Hiding the SSID from scans doesn't actually add security, it mostly just causes your own wireless clients to have extra hassles trying to find your network, because they can't find it with a broadcast scan; they have to go back and scan each channel with the SSID specified in the Probe Requests, which takes extra time.
If it's a 5GHz-only network, make sure it's not on a Radar/DFS channel. Channels 36-48 are usually non-DFS; channels 149-165 are non-DFS in some regions like FCC (US & Canada). Channels 52-140 are usually DFS channels. DFS channels have to be scanned passively, which makes them slower to scan.
My hunch is that your client is trying to get you online as soon as possible, so it's doing a broadcast scan of the active-scan (non-DFS) channels, and when it sees a network on the Preferred Networks list in this scan, it joins that network right away rather than doing the slower rescans to keep looking for a more-preferred network.
One last tip: In 2.4GHz, putting your AP on channel 1, 6, or 11 can make it even a little quicker to be seen in scans, because some clients scan those three channels first, since most professionally-designed networks only use those three channels for their 2.4GHz radios.