Welcome to the HIV forum.
To my knowledge, nobody has ever been known to have acquired HIV through injury by discarded injection equipment, even when that equipment had been used for injection drug use. It is primarily a theoretical risk. HIV dies quickly in the environment, and to my knowledge all sharp instrument injuries that have actually resulted in HIV transmission involved immediate injury of health care providers while in the process of providing care to HIV infected persons. Usually these involved large-bore needles, scalpel injuries, and so on, with obvious exposure to substantial amounts of patients' blood. Even in health care situations involving fresh exposures, infection rarely results from small-bore needle, superficial pricks, and so on, if there was no visible blood and a substantial, deep injury.
In addition, when a contaminated needle passes through materials like clothing, or even through a single layer of latex (i.e., rubber glove), most or all contaminated secretions on the surface of the needle are wiped clean, reducing the transmission risk. The thickness of the sole of a shoe would provide substantial protection.
For these reasons, the chance you were infected is exceedingly low. However, I cannot say there was zero risk. The ER doc was being conservative in prescribing post-exposure prophylaxis (PEP) in this situation, but s/he might have been following specific local guidelines, e.g. from the San Francisco or California health department(s).
The effectiveness of PEP depends on how quickly it is started. Every hour counts, and starting later than 72 hours is believed to have no benefit. Therefore, if in doubt, you should immediately start taking the treatment as prescribed. You can always stop later. Your eventual decision should NOT be based on my opinion or on the basis of any online source. You should find a health care provider who understands HIV prevention. There are, of course, hundreds of such persons in the San Francisco area. The San Francisco General Hospital emergency department would be a good option; or phone the San Francisco health department or the state health dept's HIV/AIDS office (in Berkeley) for their advice.
Thus, in summary: I doubt there was much risk and probably I would not take PEP if I were in your situation. But you need to check with official sources and/or locally knowledgeable experts. In the meantime, start taking the drug as prescribed. Please return to let us know what other advice you can find and your final decision on continuing it.
Good luck-- HHH, MD