You can set up memberships to be "required" so that you can force customers to have memberships when purchasing certain products. Whether it's a program registration fee or a product from your Cash Register page.
To require a membership for a product, go to the Product Set-up page and click Settings. For any product, you can select the required membership(s) the customer will need in order to purchase or register for the product in the shopping cart.
If a customer has any of these required memberships they can purchase the product. If they don't have a current membership, they will be prompted to purchase one of the applicable memberships before checking out.
UPDATE: There is now a membership prompt when adding a customer to a roster with a product fee that has a required membership associated with it. The shopping cart will appear with the option to select a required membership. This feature is designed to help your staff remember to collect the membership when adding customers to the roster. The shopping cart can be closed if you don't want to collect it at the time of registration.
Your company can bypass the auto prompt on the admin side by going to Company Settings. Under the Location tab there is a check box to disable "Automatically add the fee or membership associated to a team, class, or camp to the cart".